#coding=utf-8
from appium import webdriver
from time import sleep
import os,time,unittest

'''给手机快速装app的方法'''

PATH=lambda p :os.path.abspath(os.path.join(os.path.dirname(__file__),p))

desired_caps ={}
desired_caps['device'] = 'android' #系统
desired_caps['platformName'] = 'Android'
desired_caps['version'] = '4.1.1' #系统版本
desired_caps['deviceName'] = 'HTC S720t' #机器型号
desired_caps['automationName'] = 'selendroid' #版本小于4.2.2(api17)都需要指定selendroid
#desired_caps['app'] = PATH('D:\\jinritoutiao_545.apk')
desired_caps['app'] = PATH('D:\\weixin_780.apk') #被测试app在电脑上的位置

dr = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

sleep(5)
dr.quit()

相关文章:

  • 2021-09-20
  • 2021-09-05
  • 2021-08-13
  • 2021-08-15
  • 2022-12-23
  • 2021-11-23
  • 2021-12-19
  • 2021-04-13
猜你喜欢
  • 2021-07-02
  • 2021-05-13
  • 2021-07-26
  • 2021-09-07
  • 2021-11-13
  • 2021-08-07
相关资源
相似解决方案