1 Star 0 Fork 0

Solitary pursuit of defeat/code_repository

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DemoCalculator.py 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
Solitary pursuit of defeat 提交于 2023-05-24 11:54 . e e
from appium import webdriver
# from selenium.webdriver.common.by import By
from appium.webdriver import WebElement
from appium.webdriver.common.mobileby import MobileBy
from time import sleep
import random
# desired_caps={
# "automationName": "UiAutomator2",
# "platformName": "Android",
# "platformVersion": "6.0",
# "deviceName": "Custom Phone",
# "appPackage": "com.android.calculator2",
# "appActivity": ".Calculator",
# "unicodeKeyboard":True,# 支持中文输入,默认false
# "resetKeyboard":True,# 重置输入法为系统默认,将键盘给隐藏起来
# "noReset": True, # 不重新安装apk
# "noSign": True # 不重新签名apk
# }
desired_caps={
"automationName":"UiAutomator2",
"platformName": "Android",
"platformVersion": "8.0",
"deviceName": "Custom Phone",
"appPackage": "com.android.calculator2",
"appActivity": ".Calculator",
"unicodeKeyboard":True,# 支持中文输入,默认false
"resetKeyboard":True,# 重置输入法为系统默认,将键盘给隐藏起来
"noReset": True, # 不重新安装apk
"noSign": True # 不重新签名apk
}
driver=webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
n8 = driver.find_element_by_id("com.android.calculator2:id/digit_8")
n8.click()
elplus = driver.find_element_by_accessibility_id("加")
elplus.click()
n1 = driver.find_element_by_id("com.android.calculator2:id/digit_1")
n1.click()
driver.find_element(MobileBy.ACCESSIBILITY_ID,"等于").click()
sleep(3)
driver.quit()
马建仓 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