1 Star 0 Fork 0

Solitary pursuit of defeat/code_repository

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
demo3005.py 965 Bytes
一键复制 编辑 原始数据 按行查看 历史
Solitary pursuit of defeat 提交于 2023-05-24 11:54 . 555
from appium import webdriver
from time import sleep
from appium.webdriver.common.mobileby import MobileBy
caps={}
caps['platformName']='Android'
caps['platformVersion']='8.0'
caps['deviceName']='192.168.236.101:5555'
caps['appPackage']='com.android.calculator2'#计算器
caps['appActivity']='.Calculator'
driver=webdriver.Remote('http://localhost:4723/wd/hub',caps)#启动App
sleep(2)
# 点击3 resource-id属性值:com.android.calculator2:id/digit_3
driver.find_element(MobileBy.ID,'com.android.calculator2:id/digit_3').click()
# 点击+ resource-id属性值:com.android.calculator2:id/op_add
driver.find_element(MobileBy.ID,'op_add').click()
# 点击5 resource-id属性值:com.android.calculator2:id/digit_5
driver.find_element(MobileBy.ID,'com.android.calculator2:id/digit_5').click()
# 点击= resource-id属性值: com.android.calculator2:id/eq
driver.find_element(MobileBy.ID,'eq').click()
sleep(3)
driver.quit()#关闭App
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yuanliangliang_repotory/cede_repotory.git
git@gitee.com:yuanliangliang_repotory/cede_repotory.git
yuanliangliang_repotory
cede_repotory
code_repository
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385