Appium+python Mobile Automation Test (iii)--demo

Source: Internet
Author: User
Tags appium

Write in front:

    1. Appium environment is set up, Genymotion Simulator is also configured OK, then began to write the first demo

First, get the APK package name

    1. Open cmd, enter the instruction AAPT dump badging D:\test\xxx.apk (full name of the APK, such as magic Diffuse camera apk). If the package name is obtained through Appium, it may not be accurate.
    2. Package Name: com.manboker.headportrait

Ii. acquisition of Launcheractivity

    1. Take the previous step, and then the CMD interface to look up. The launcheractivity value of the magic diffuse camera is Com.manboker.headportrait.activities.FirstActivit

Third, demo

    1. Platformname:android apk
    2. DeviceName: Phone device name, CMD interface through ADB devices command view
    3. Platformversion:android System Version number
    4. APPPACKAGE:APK Package Name
    5. appactivity:apk launcheractivity
      (Ps is copy from elsewhere)

Four, running Appium

    1. Configure the IP address if you do not know the default. Then click on the small triangle on the right to run.

Five, the Code

# Coding=utf-8

From Appium import Webdriver

Desired_caps = {

' PlatformName ': ' Android ',

' DeviceName ': ' 192.168.56.101:5555 ',

' Platformversion ': ' 6.0 ',

# APK Package Name

' Apppackage ': ' com.manboker.headportrait ',

# APK for Launcheractivity

' appactivity ': ' Com.manboker.headportrait.activities.FirstActivit '

}

Driver = Webdriver. Remote (' Http://127.0.0.1:4723/wd/hub ', desired_caps)

Appium+python Mobile Automation Test (iii)--demo

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.