Robot Framework Using Python, Key Press Without Selecting Any Button or Element in the Page

How do you send special keys in Selenium Library/Robot Framework?

You can use the seleniumlibrary built in keyword Press Key along with the corresponding ASCII code of the certain key you want to press.

For your question if you wanted to send "F12" you would do the following.

press key    (An element on the page)    \\86

86 is the ASCII code for F12, and the documentation for this keyword explicitly says for it to be called on an element of the page. You can read more about it here.

http://robotframework.org/Selenium2Library/Selenium2Library.html#Press%20Key

Press Special Key [C_DOWN] 20times in sikuliLibrary

From the Sikuli documentation:

http://rainmanwy.github.io/robotframework-SikuliLibrary/doc/SikuliLibrary.html

... "Press Special Key" only takes one parameter, the key. C_DOWN looks like a valid key constant per the documentation here:

http://doc.sikuli.org/javadoc/org/sikuli/script/Key.html

The Robot Framework has a FOR loop construct for performing a command multiple times, documented here:

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#for-loops

I would suggest

FOR    ${index}    IN RANGE    20
Press Special Key C_DOWN
END

(This is presuming the environment etc is allowing you to execute the Press Special Key directive correctly, as the question isn't completely clear on this point.



Related Topics



Leave a reply



Submit