Simulate enter key

Hi,

I’m trying to insert a value to a field of a web application. This field has linked a javascript function that is activated by pressing the enter key.

When I run the recording in the “type into input” I insert the value [k (enter)]:

When I run the registration I obtain an incorrect behavior:

Regards :slight_smile:

Thank you

1 Like

Dave Burns September 28, 2016 17:53
Hi

You need to enter “1234” + “[k(enter)]”

This should work for you

Dave

12 Likes

Andrzej.Kniola September 28, 2016 17:59
Hi,

Both should work, it’s just a static text conversion of the final expression (string).

Reason of it not working might be the method - special keys [k(keycode)] don’t work with SimulateType method.

By the way - if you’ll need to type the actual [ character with either default or WIndowMessages method, you’ll need to escape it (use [[, similar to slash escaping in C#), otherwise it will cut the string on this character.

Regards.

2 Likes

Gianluca Alghisi September 28, 2016 18:17
I try this method:

“1234” + “[k(enter)]” → KO

“1234” + “[[k(enter)]]” → KO

“1234[[k(enter)]]” → KO

“1234” + [k(enter)] → Compiler Error

Thanks

Regards

1 Like

Andrzej.Kniola September 28, 2016 18:22
KO?

You might want to reread on InputMethods:

Regards.

PS. The double bracket escaping ( [[ ) is only needed if you don’t want to use a special key, like enter or tab, but want the robot to type the actual bracket [ character in the text.

2 Likes

Gianluca Alghisi September 28, 2016 18:45
Correct. Now it works.

In the properties unflag SimulateType and flag Activate:

thank you very much :slight_smile:

6 Likes

Thank you Gianluca.