Python全系列 教程
3567个小节阅读:5930.1k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
Appium 类库封装了标准的Selenium客户端库
Appium服务端定义了官方协议的扩展,为appium用户提供了方便的接口来执行各种设备动作
Python控制Appium可以使用3方模块appium-python-client
xxxxxxxxxx
pip install Appium-Python-Client==2.6.1
xxxxxxxxxx
desired = {
"platformName": "Android",
"appPackage": "cn.kuwo.player",
"appActivity": "cn.kuwo.player.activities.EntryActivity",
"platformVersion": "5.1.1",
"deviceName": "OPPO R11 Plus"
}
server = 'http://localhost:4723/wd/hub'
# 新建一个driver
driver = webdriver.Remote(server, desired)
通过Appium获取驱动对象,即可根据不同方法获取元素,比如:xpath、id、class_name。 可以根据selenium用法开发即可
xxxxxxxxxx
find_element()
find_elements()
xxxxxxxxxx
element.text
xxxxxxxxxx
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 15)
实时效果反馈
1. 关于python操作Appium, 说法错误的是?
A 需要使用3方模块操作
B 操作方法类似selenium方法
C 需要配置模拟器地址
D 必须使用本地虚拟手机
答案
1=>D