2021年4月25日星期日

How do I press keyboard with robot framework?

I am automating one application using Robot Framework using Python. In a certain situation I need to press Command+A to select all , I have used ASCII Table (http://www.physics.udel.edu/~watson/scen103/ascii.html), selenium.webdriver.common.keys(https://www.selenium.dev/selenium/docs/api/py/webdriver/selenium.webdriver.common.keys.html) , but it still not work, the detail below as :

environment

os: mac 10.15.7

code editing : visual studio code

code

***setting***  Library   OperatingSystem  Library   DateTime  Library   OperatingSystem  Library   RequestsLibrary  Library   BuiltIn  Library   Collections  Library   json  Library   Selenium2Library  Resource  ./resource1.robot    *** Variables ***  ${collection_name}    //input[@name='name']    ***Test case***  press keys   ${collection_name}  \\1  

actually result

key"\1" in the locator actually result

expect result

select all in the locator/

expect result

Is there a solution to get rid of this problem? thanks

https://stackoverflow.com/questions/67260285/how-do-i-press-keyboard-with-robot-framework April 26, 2021 at 10:56AM

没有评论:

发表评论