Hi,
I try to type into a few lines of text into a web input box, and I have stored the text into a text variable. When I use WriteLine Activity to test the text variable, all the lines are shown correctly. But when I use Type Into Activity to write the text into the web text box, all the lines are appended together.
Is there a way to keep the text in its original separated lines ?
Thanks
Snowman
anil5
(Anil Kumar Bandam)
April 25, 2019, 4:43am
2
Hi @Snowman ,
How you want the text to be printed in type into and how it is printed can you provide both screenshots.
For example:
In the string variable, it is
“I am a boy
She is a girl”
But when using type into, the web input box show:
I am a boyShe is a girl
Yoichi
(Yoichi)
April 25, 2019, 4:46am
4
Hi,
If you want to input to TextArea on IE11 with TypeInto Simulate Type method, you need to replace CR+LF with ‘\n’.
lakshman
(Ganta lakshman)
April 25, 2019, 4:48am
5
@Snowman ,
In type Into, try like this: “laxman”+vbcrlf+“ganta”
here, vbcrlf is for going to next line
1 Like
Thanks,
Shall I first replace all CR+LF from my string variable with ‘\n’ first ?
As I have many lines, can I use string.Replace or I have to use Regex ?
anil5
(Anil Kumar Bandam)
April 25, 2019, 4:57am
7
Use Regular expression
Regex.Replace(content,“\r\n”,vbCrLf)
Where content has the output of above write line screenshot
1 Like
Yoichi
(Yoichi)
April 25, 2019, 4:59am
8
Hi,
You can use string.Replace as follows:
yourString.replace(System.Environment.Newline,“\n”)
Dear both,
Thanks a lot, and much appreciated your prompt advice.
Will check them out.
Sherman
1 Like
Dear both,
I tried both your methods choosing “Simulate Type”, but both don’t work.
But when I choose SendWindowMessages, both works.
Thanks.
2 Likes
system
(system)
Closed
April 28, 2019, 1:05pm
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.