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")
source
share