Robotframework Automated Testing framework-Mobile phone Automation test Click the use of the element keyword

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.