selenium 4 raises exception without useful message

selenium 4 raises exception

example code:

python 复制代码
driver = webdriver.Chrome()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

issue log:

复制代码
Traceback (most recent call last):
...
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:

investigation:

Run below code:

python 复制代码
from selenium import webdriver
import logging

logging.basicConfig(level=logging.DEBUG)

def main() -> int:
    browser = webdriver.Firefox()
    browser.get('http://selenium.dev/')
    return 0
    
if __name__ == "__main__":
    raise SystemExit(main())

From the output, it shows something related to proxy.

solution:

  • downgrade to selenium 3.14.1
  • remove proxy in environment variable

github issue

相关推荐
天才测试猿1 小时前
Chrome浏览器+Postman做接口测试
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
线束线缆组件品替网2 小时前
Panduit 数据中心布线设计实战解析
数码相机·测试工具·智能手机·电脑·pcb工艺·智能手表·智能电视
望未来无悔2 小时前
自动化测试—Selenium(Java)
selenium·测试工具
Jinkxs2 小时前
AI - 测试工程师会被 AI 取代吗?我用 AI 测试工具干了 3 个月,结论很意外
人工智能·测试工具
正方形的轮子2 小时前
testmouse.com 一款免费的在线鼠标测试工具
测试工具·计算机外设
饿了么骑手贪大心3 小时前
简单易用的网络测试工具——Clumsy使用总结
网络·测试工具
天若有情6733 小时前
【Python】从0到1实现轻量级接口测试工具:基于Python+FastAPI+Pytest
python·测试工具·fastapi
王潇洒呀3 小时前
AI+测试工具《Testim》使用说明
人工智能·测试工具
软件测试君3 小时前
2025年10款王炸AI测试工具,你用过几款?
自动化测试·软件测试·人工智能·深度学习·测试工具·单元测试·ai测试工具
霍格沃兹测试学院-小舟畅学3 小时前
Playwright测试数据模拟:Mock Service Worker使用指南
人工智能·测试工具·arcgis