用webdriver做UI自动化,运行到点击搜索时报错,检查不出问题,大家看一下,遇到过这种情况怎么解决 错误信息: - selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="searchBtn"]"}
- (Session info: chrome=89.0.4389.90)
复制代码程序: driver.find_element_by_id("searchBtn").click() 点击搜索 --------报错行---------- - sleep(3)
- driver.quit()
- 报错信息:
- Traceback (most recent call last):
- File "D:/软件安装/pycharm/和包2.0/UI/demo1.py", line 26, in
- driver.find_element_by_id("searchBtn").click()
- selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="searchBtn"]"}
- (Session info: chrome=89.0.4389.90)
复制代码
|