The click Element keyword is used to simulate clicking an element on the app interface, which receives a parameter [locator], where locator refers to the way the interface element is positioned.
Example 1: Use the click Element keyword to simulate clicking on a button, where locator uses name to locate the element that needs to be clicked, and still uses the app interface previously used to do the operation example.
Open application Http://localhost:4723/wd/hub platformname=android platformversion=22 DEVICENAME=98YFBP522VSU app=c:/users/yongqing/desktop/app-debug.apk Apppackage=com.example.calculator appActivity=MainActivity
Input Text accessibility_id= Entry box 23
Input Text Id=com.example.calculator:id/factortwo 12
Click Element name= Calculation
Execution Result:
Starting test:RobotFrameworkTest1.TestSuite5.TestCase007
20170510 15:13:18.868:info:typing text ' into text field ' accessibility_id= input box '
20170510 15:13:18.868:info:msg:find accessibility_id= Input Box
20170510 15:13:25.718:info:msg:find Id=com.example.calculator:id/factortwo
20170510 15:13:31.077:info:clicking element ' name= calculation '.
20170510 15:13:31.077:info:msg:find name= Calculation
20170510 15:13:31.704:info:elements: [<appium.webdriver.webelement.webelement (session= " 3b92f067-4ddd-4dc5-90eb-c6915eb8e364 ", element=" 3 ");]
Ending test:RobotFrameworkTest1.TestSuite5.TestCase007
From the execution results you can see that the click Element keyword can also be simulated by clicking on a button.
Robotframework Automated Testing framework-Mobile phone Automation test Click the use of the element keyword