Type Into Activity - skipped all new line

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

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

Hi,

If you want to input to TextArea on IE11 with TypeInto Simulate Type method, you need to replace CR+LF with ‘\n’.

@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 ?

Use Regular expression

Regex.Replace(content,"\r\n",vbCrLf)

Where content has the output of above write line screenshot

1 Like

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

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.