Selenium keyPress

I am wondering how to use the selenium keyPress function to enter a string, it is easy to enter a single character:

selenium.keyPress("id=textbox", "\\119") (which  is character 'w');

but how can I insert a string into the string "face"? The following code will work, but ugly:

selenium.keyPress("id=textbox", "\\102") (which  is character 'f');
selenium.keyPress("id=textbox", "\\97") (which  is character 'a');
selenium.keyPress("id=textbox", "\\99") (which  is character 'c');
selenium.keyPress("id=textbox", "\\101") (which  is character 'e');

and this one will not work:

selenium.keyPress("id=textbox", "\\102\\97\\99\\101")
+3
source share
2 answers

Try using " typeKeys(id=textbox,face)".

Or, if you want to do it quickly, you can use typeand for the last char you can use keyPressto trigger a keystroke event.

+1
source

Tried a command like? | type | //input[@name='searchTerms'] | test |

0
source

Source: https://habr.com/ru/post/1786568/