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

相关推荐
测试老哥20 分钟前
接口自动化测试分层设计与实践总结
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·接口测试
ClouGence1 小时前
Selenium vs CueCast:自动化测试一定要写代码吗?
selenium·测试
goodesocket2 小时前
市面上测试稳定可靠的内存条测试治具公司芯片检测利器
测试工具
可可南木20 小时前
3070文件格式--23--fixture文件 5
功能测试·测试工具·pcb工艺
小白上线*^_^*1 天前
Jmeter从入门到精通指南
软件测试·测试工具·jmeter·接口测试·测试工程师
goodesocket2 天前
手机LPDDR芯片测试座厂商适配性强
测试工具
ClouGence2 天前
自动化测试,如何让每个用例都保持登录状态?
selenium·测试
ClouGence2 天前
手动测试工程师有必要学自动化测试吗?手工测试还有前途吗?
selenium·测试·求职
小小测试开发3 天前
Playwright vs Selenium vs Cypress:从浏览器协议到 API 设计的全面对比与实测
人工智能·selenium·测试工具
我的xiaodoujiao3 天前
快速学习Python基础知识详细图文教程9--函数进阶
开发语言·python·学习·测试工具