appium 计算器demo

时间:2023-03-08 18:03:19

appium 计算器demo

需要修改的是

platformVersion
deviceName
demo:
#coding=utf-
from appium import webdriver
import time
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '5.0.2'
desired_caps['deviceName'] = 'QOKNIFPV99999999'
desired_caps['appPackage'] = 'com.android.bbkcalculator'
desired_caps['appActivity'] = 'com.android.bbkcalculator.Calculator'
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
driver.find_element_by_id("com.android.bbkcalculator:id/digit1").click()
driver.find_element_by_id("com.android.bbkcalculator:id/plus").click()
driver.find_element_by_id("com.android.bbkcalculator:id/digit9").click()
driver.find_element_by_id("com.android.bbkcalculator:id/equal").click()
time.sleep()
driver.quit()

参考:

https://www.jianshu.com/p/cb5bced7e540

https://www.cnblogs.com/good-time/p/7678206.html

https://blog.****.net/u012681539/article/details/79975957