Appium+python Environment Construction

Source: Internet
Author: User
Tags appium

First, the environment

1. Install Python.

2, install Appium.

3. Install Pip

4, installation Selenium

5, install appium-python-client #cmd->cd setuptools\pip Install appium-python-client

Second, appium configuration

After starting Appium, click android Robot

Third, write the script

1 #-*-coding:utf-8-*-2 3 4 ImportUnitTest5 ImportOS6 ImportSYS7  fromTimeImportSleep8  fromAppiumImportWebdriver9 Ten classHelloWorld (unittest. TestCase): One     deftest_ssq (self): ADesired_caps = {} -desired_caps['PlatformName'] ='Android' -desired_caps['platformversion'] ='4.4.4' thedesired_caps['Apppackage'] ='Com.golive.lottery' -desired_caps['appactivity'] ='. Activity. Homeactivity' -desired_caps['devicename'] ='172.17.2.69:5555' -  +Driver = Webdriver. Remote ('Http://127.0.0.1:4723/wd/hub', Desired_caps) -  +Time.sleep (5) A  atSSQ = driver.find_element_by_id ('com.golive.lottery:id/lottery_ssq'). Click () -  -  - if __name__=='__main__': -Suite =UnitTest. Testloader (). Loadtestsfromtestcase (HelloWorld) -UnitTest. Texttestrunner (verbosity=2). Run (Suite) in         

Appium+python Environment Construction

Related Article

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.