selenium+python+appium真机测试
前面说了web测试,app测试是在web基础上加上appium
1、安装Appium-Python-Client
pip install Appium-Python-Client
pyCharm点击file——setting——project interpreter——+——搜索Appium-Python-Client下载
真机连接
#coding=utf-8
import os
from appium import webdriver
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
)
desired_caps = {}
#不每次运行都安装app
desired_caps['noReset'] = 'true'
desired_caps['fullReset'] = 'false'
#设备设置
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0.1'
desired_caps['deviceName']='ad9a96f7'#这是测试机的型号,uuid
desired_caps['app'] = PATH('E:\\下载\\com.app.qunadai_5.8.10_168.apk')#被测试的App在电脑上的位置
#desired_caps['appPackage'] = 'com.app.qunadai'
#desired_caps['appActivity'] = '.content.ui.MainActivity'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
driver.implicitly_wait(5)
driver.find_element_by_id("com.app.qunadai:id/rb_nav_market").click()
driver.quit() 顶
页:
[1]