python自动化:appium中获取toast

实现代码如下:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class toast:
    def is_toast_exist(self,driver,text,timeout=30, poll_frequency=0.5):
        try:
            toast_loc = ("xpath", "//*[contains(@text,%s)]"%text)
            WebDriverWait(driver, timeout, poll_frequency).until(EC.presence_of_element_located(toast_loc))
            return True
        except:
            return False

python自动化:appium中获取toast

上一篇:AI视觉训练营——第一天学习记录


下一篇:利用kali生成木马远程控制安卓手机