appium python demo

时间:2022-04-19 02:39:04

#coding=utf-8
from appium import webdriver
desired_caps={}
desired_caps["platformName"]="Android"
desired_caps["platformVersion"]="4.2.2"
desired_caps["deviceName"]="192.168.245.101:5555"
desired_caps["appPackage"]="com.android.calculator2"
desired_caps["appActivity"]=".Calculator"
desired_caps["newCommandTimeout"]=600
dr=webdriver.Remote("http://127.0.0.1:4723/wd/hub",desired_caps)
dr.find_element_by_name("1").click()
dr.find_element_by_name("5").click()
'''
#coding=utf-8
from appium import webdriver
desired_caps={}
desired_caps["platformName"]="Android"
desired_caps["platformVersion"]="4.2.2"
desired_caps["deviceName"]="192.168.65.101:5555"
desired_caps["appPackage"]="com.xgh.sport"
desired_caps["appActivity"]=".activity.MainActivity"
desired_caps["unicodeKeyboard"]=True
desired_caps["resetKeyboard"]=True
desired_caps["newCommandTimeout"]=1800
dr=webdriver.Remote("http://127.0.0.1:4723/wd/hub",desired_caps)