(Vi) appium works and Desired Capabilities Detailed

1. Recalling the principle of appium

2. Start Taobao apk Case

3.Desired Capabilities

 

Desired Capsbilities official explanation:

http://appium.io/docs/en/writing-running-appium/caps/

===================================================================

APPium principle

 

 

 

 

 

 

 

 

 

 

Listening port 4723, the client sends a request to the server, the server converts the request into a command recognizable machine interface through the API transmitted to the mobile terminal, the mobile terminal returns the result to the End Run server, the server then returns the results to the client

 

 

 

==========================================================================

Start Taobao apk Case

How to start Taobao apk by pycharm + appium + Yagami simulator (or real machine)?

After 1.pycharm python new construction, the need for a corresponding packet in the set appium

 

 

 

 

 

 

 

 

 

 

 

 

 

2.appium open service

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. Connect simulator or a real machine, download the emulator or real good before the aircraft is equipped with Taobao apk

Code + style explain:

'' 'Open Taobao APP' ''

#coding=utf-8

from appium import webdriver

import time

desired_caps = {

    # Mobile operating systems

    'platformName':'Android',

 

    # Mobile device name, view through adb devices             

    'deviceName':'127.0.0.1:62001',        #'FESKI7YPRO999LVW',

    # Mobile version

    'platformVersion':'5.1.1',

    #app包名,通过aapt dump badging ****.apk查看

    'appPackage':'com.taobao.taobao',

    #appActivity,通过aapt dump badging ****.apk查看

    'appActivity':'com.taobao.tao.welcome.Welcome'

    }

driver=webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps)

driver.implicitly_wait(5)

time.sleep(5)

 

 

肯定对Desired Caps有疑问,为什么要填入这些参数?

====================================================================

Desired Capabilities详解

什么是Desired Capabilities?

Desired Capabilities 是一些发送给appium服务器的键值对组合,由 keys 和 values 组成的 JSON 对象。它告诉服务器我们想启动什么样类型的自动化会话

常用基本参数:

 

 

 

 

 

 

 

 

 

 

Android特有参数:

 

 

 

 

 

 

 

 

 

 

 

iOS特有参数:

 

Guess you like

Origin www.cnblogs.com/wx921308494/p/11967016.html