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

相关推荐
川石课堂软件测试2 小时前
APP自动化测试|高级手势操作&toast操作
css·功能测试·测试工具·microsoft·fiddler·单元测试·harmonyos
LT10157974445 小时前
2026年开源自动化测试工具选型指南:功能与适用场景解析
测试工具·开源·自动化
大叔带刺1 天前
AutoSAR SomeIP配置开发速成_02测试工具开发
测试工具·someip
糖果店的幽灵1 天前
软件测试接口测试从入门到精通:其他接口测试工具
软件测试·测试工具·接口测试·apifox·insomnia
皮皮蟹虾饺1 天前
tcpdump指南:从基础抓包到 BPF 高级过滤与生产实战
测试工具·php·tcpdump
糖果店的幽灵1 天前
软件测试接口测试从入门到精通:Postman入门到精通
软件测试·测试工具·接口测试·postman·api测试
墨香幽梦客2 天前
API集成最佳实践:Postman+MuleSoft实现ERP与OA系统无缝对接
测试工具·postman
DrMaker2 天前
【无标题】
软件测试·python·测试工具·pyqt
努力的lpp2 天前
渗透主流工具完整参数手册(sqlmap、Nmap、Hydra、Dirsearch、Xray)
javascript·网络协议·测试工具·安全·http·工具
小白学大数据3 天前
线上故障急救:依托 OpenClaw 日志排查 403 和 503 问题
爬虫·python·selenium·数据分析