First Appium Script

Source: Internet
Author: User

This article briefly describes how to write automated scripts using Utraedit.

In any directory of the computer, create a new hello_appium.py file, appium-python-client-0.25.tar.gz and selenium-3.8.0.tar.gz extracted from the Appium folder and selenium The folder is placed in the same directory as the hello_appium.py sibling, and you can start writing code.

1  fromappium Import Webdriver2 Import Time3  4desired_caps={}5desired_caps['PlatformName']='Android'6desired_caps['platformversion']='4.4.2'7desired_caps['devicename']='7n2sse158p001892'8desired_caps['NoReset']='NoReset'9desired_caps['Apppackage']='Com.gomo.calculator'Tendesired_caps['appactivity']='. Ui.activity.MainActivity' OneDriver=webdriver. Remote ('Http://localhost:4723/wd/hub', desired_caps) #实例化driver ASelf.driver.implicitly_wait (Ten) #设置隐式等待时间 -  -DRIVER.FIND_ELEMENT_BY_ID ("com.gomo.calculator:id/input_num_1"). Click () theDRIVER.FIND_ELEMENT_BY_ID ("com.gomo.calculator:id/input_num_5"). Click () -DRIVER.FIND_ELEMENT_BY_ID ("Com.gomo.calculator:id/display_op_add"). Click () -DRIVER.FIND_ELEMENT_BY_ID ("Com.gomo.calculator:id/input_num_6"). Click () -DRIVER.FIND_ELEMENT_BY_ID ("com.gomo.calculator:id/display_eq"). Click () +Driver.quit ()

How to run:

Open cmd, enter Python hello_appium.py (preferably full path), enter

This is the simplest application of appium.

First Appium Script

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.