获取toast text封装,传入toast 部分文本,返回全部文本
def get_toast_text(self,text): try: toast_loc = (By.XPATH, "//*[contains(@text,‘"+text+"‘)]") logger.info(toast_loc) ele = WebDriverWait(self.driver, 10, 0.1).until(EC.presence_of_element_located(toast_loc)) return ele.text except: return None
原文地址:https://www.cnblogs.com/testway/p/9348178.html
时间: 2024-10-17 14:30:52