appium+python 第一个小测试

import os,time,unittest
#from selenium import webdriver
from appium import webdriver

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

desired_caps ={}
desired_caps['platformName']='Android'
desired_caps['platformVersion']='5.1.1'
desired_caps['deviceName'] = 'vivo X7'

desired_caps['app'] = PATH(r'C:\Users\Administrator\Desktop\app-debug.apk')
desired_caps['appPackage'] = 'com.xx.xx'
desired_caps['appActivity'] = 'com.xx.xx.activity.MainActivity'


driver = webdriver.Remote("http://localhost:4723/wd/hub", desired_caps)

time.sleep(10)

#driver.find_element_by_name("0").click()
time.sleep(3)
driver.find_element_by_id("com.xx.xx:id/face_filter_btn").click()

driver.quit()

 

posted @ 2017-09-25 10:57  南柯南  阅读(222)  评论(0编辑  收藏  举报