码迷,mamicode.com
首页 > 移动开发 > 详细

python+appuim 处理系统权限弹窗

时间:2019-04-30 12:28:44      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:app   log   ons   common   exp   com   element   sel   from   

from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

 def always_allow(self,driver,number=2):
        logger.info("跳过系统权限")
        for i in range(number):
            allow_button = (By.XPATH, self.allow)
            try:
                a_button = WebDriverWait(self.driver,1,0.5).until(EC.presence_of_element_located(allow_button))
                a_button.click()
            except Exception as e:
                pass

 

python+appuim 处理系统权限弹窗

标签:app   log   ons   common   exp   com   element   sel   from   

原文地址:https://www.cnblogs.com/wx2017/p/10795088.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!