Appium Beginner (5)--appium test Case (1)

Source: Internet
Author: User

Start the AVD, start the Appium, write the use case (Python), execute

First, start the Android simulator

Second, start Appium Server

Double-click the Appium icon to start, configure the Appium Android Settings, and the platformversion corresponding to the AVD configuration in the Target;device name corresponding to the AVD name in the AVD

General settings just keep it by default.

Click on the upper-right corner to start Appium, the default occupation of the local 4723 port, that is: 127.0.0.1:4723

Third, write Python code

Writing code in the Notepad or Python editor

#Coding=utf-8 fromAppiumImportWebdriver Desired_caps={} desired_caps['PlatformName'] ='Android'desired_caps['platformversion'] ='5.0.1'desired_caps['devicename'] ='Android Emulator'desired_caps['Apppackage'] ='Com.android.calculator2'desired_caps['appactivity'] ='. Calculator'Driver= Webdriver. Remote ('Http://localhost:4723/wd/hub', Desired_caps) driver.find_element_by_name ("1"). Click () driver.find_element_by_name ("5"). Click () driver.find_element_by_name ("9"). Click () driver.find_element_by_name ("Delete"). Click () driver.find_element_by_name ("9"). Click () driver.find_element_by_name ("5"). Click () driver.find_element_by_name ("+"). Click () driver.find_element_by_name ("6"). Click () driver.find_element_by_name ("="). Click () driver.quit ()

Four, the operation

CMD, enter Python d:\mk\test.py, run the app is the android comes with the calculator.

Appium Beginner (5)--appium test Case (1)

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.