appium+python实现andriod自动化问题
#coding=utf-8importtimefromappiumimportwebdriver如下代码执行后没有报错,andriod上APP启动了,但是没有模拟点击操作...
#coding=utf-8
import time
from appium import webdriver
如下代码执行后没有报错,andriod上APP启动了,但是没有模拟点击操作,就停留在页面上面
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'SOPNFEFEHUNFKFZ5'
#直接在appium上设置APP路径就好,会自动检测如下信息
#desired_caps['appPackage'] = 'com.android.yzt'
#desired_caps['appActivity'] = '.MainActivity'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
time.sleep(20)
#driver.find_element_by_id('com.pingan.yzt:id/text_skip').click()
driver.find_elements_by_android_uiautomator("new UiSelector().text(\"登录/注册\")")
time.sleep(5)
driver.quit() 展开
import time
from appium import webdriver
如下代码执行后没有报错,andriod上APP启动了,但是没有模拟点击操作,就停留在页面上面
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'SOPNFEFEHUNFKFZ5'
#直接在appium上设置APP路径就好,会自动检测如下信息
#desired_caps['appPackage'] = 'com.android.yzt'
#desired_caps['appActivity'] = '.MainActivity'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
time.sleep(20)
#driver.find_element_by_id('com.pingan.yzt:id/text_skip').click()
driver.find_elements_by_android_uiautomator("new UiSelector().text(\"登录/注册\")")
time.sleep(5)
driver.quit() 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询