初始化里加了隐式等待
self.driver.implicitly_wait(10)
每个查找元素都是用的find方法
def find(self, locator):
result: WebElement = WebDriverWait(self.driver, timeout=20).until(EC.element_to_be_clickable(locator))
return result
元素定位器:
finish = ('xpath', '//*[@text="完成"]')
每当程序运行到self.find(finish).click() 就会报错。
报错信息:
selenium.common.exeptions.TimeoutException
单独运行这条case时不会报错,使用命令行运行pytest -v -s test_xxxx.py 时到这行代码就会报错。。。求解