I am trying to send F12
using in Robot Framework, probably by using Selenium Library's send special key
.
I found this page that lists keycodes for common uncommon keys https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.keys.html where F12
is listed as \ue03c.
I have tried all combinations I could imagine of backslashes and quotations but none of them work. How do I send F12 in Robot Framework?
Furthermore, in the next step I need to send F16 but it is not listed in the linked page - how do I send that?
Edit: I don't need to send the key to a specific element or so, I just want to trigger a menu option using its keyboard shortcut.
Edit 2: I am limited to Selenium Library 3.1.
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