困惑了两天的问题,原来是单引号和双引号问题,欠缺考虑到Java的格式
Traceback (most recent call last):
File "D:/Python/PycharmProjects/ketang/test_s/test4.py", line 34, in <module>
WebDriverWait(driver, 20).until(EC.visibility_of_element_located((MobileBy.ANDROID_UIAUTOMATOR, loc)))
File "D:\Python\Python37\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
原代码:
更改后:
loc = 'new UiSelector().text("已有账号?立即登录")' WebDriverWait(driver, 20).until(EC.visibility_of_element_located((MobileBy.ANDROID_UIAUTOMATOR, loc))) driver.find_element_by_android_uiautomator(loc).click()海染蓝 发布了6 篇原创文章 · 获赞 0 · 访问量 124 私信 关注