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

相关推荐
弹简特9 小时前
【精通Postman接口测试】01-基础理论+安装使用+项目实战+接口关联(万字图文,零基础保姆级)
测试工具·postman·接口关联
武帝为此1 天前
【Selenium 屏幕截图】
python·selenium·测试工具
武帝为此1 天前
【Selenium 执行 JavaScript】
javascript·selenium·测试工具
llilian_161 天前
晶体频率测试仪 破解晶振品控核心难题:晶体频率网络测试仪深度解析 晶体网络分析仪
网络·功能测试·单片机·嵌入式硬件·测试工具·51单片机
深念Y1 天前
从 Playwright/Selenium 到指纹浏览器:浏览器自动化技术的进阶之路
selenium·测试工具·自动化·浏览器·账号·无头浏览器·指纹浏览器
Johnstons2 天前
Wireshark ExpertInfo是什么?一文讲透异常分级、适用场景、和传统抓包阅读的区别与排查标准
网络·测试工具·wireshark·es
我的xiaodoujiao2 天前
API 接口自动化测试详细图文教程学习系列16--项目实战演练3
python·学习·测试工具·pytest
我的xiaodoujiao2 天前
API 接口自动化测试详细图文教程学习系列15--项目实战演练2
python·学习·测试工具·pytest
LT10157974442 天前
2026年低代码自动化测试平台选型指南:降低测试落地门槛
测试工具·低代码·自动化
llilian_162 天前
晶振测量仪 晶振频率测试仪器的多领域应用解析 晶振频率测试仪器
功能测试·单片机·嵌入式硬件·测试工具·51单片机