1.下图为系统弹框的问题
python代码中的处理代码:
#usr/bin/env python
#-- coding:utf-8 --
from appium import webdriver
from time import sleep
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
desired_caps= { ‘platformName’:‘Android’,
‘deviceName’:‘6EB0217810000307’,
‘appPackage’:‘cn.com.omronhealthcare.omronplus.test’,
‘appActivity’:‘cn.com.omronhealthcare.omronplus.view.WelcomeActivity’,
‘autoAcceptAlerts’: ‘true’}
print(desired_caps)
driver = webdriver.Remote(‘http://127.0.0.1:4723/wd/hub’,desired_caps) # 客户端连接服务器 appium服务器的地址
print(“初始化成功”)
sleep(2)
for i in range(5):
loc = (“xpath”, “//*[@text=‘始终允许’]”)
try:
e = WebDriverWait(driver, 1, 0.5).until(EC.presence_of_element_located(loc))
e.click()
except:
pass
2.使用UIautomaterviewer进行元素定位,代码如同上述,元素定位的为题请看:https://blog.csdn.net/ShuaiTester/article/details/100100405