Selenium - 启动后报org.openqa.selenium.InvalidArgumentException: invalid argument错

● 出现的异常:

复制代码
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DESKTOP-H7TOMMO', ip: '192.168.64.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
	at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:100)
	at java.util.Optional.orElseGet(Unknown Source)
	at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:216)
	at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:187)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
	at test.main(test.java:13)
  • 原因:firebox浏览器没有安装在默认的路径
  • 解决方案:

图中12、13行代码为火狐浏览器位置和geckodriver位置,根据你自己的情况而定!

● 成功:

● 项目背景:

相关推荐
我送炭你添花5 小时前
Pelco KBD300A 模拟器:04+1.Python 打包详解:历史、发展与多种方式对比
python·测试工具·运维开发
chuntian_tester7 小时前
Qwen通义千问大模型
测试工具·aigc
少云清8 小时前
【接口测试】3_Postman _Postman断言
测试工具·postman
我一定会有钱9 小时前
pytest基础
python·测试工具·测试用例·pytest
西游音月9 小时前
(6)pytest+Selenium自动化测试-测试用例编写
selenium·测试用例·pytest
Wpa.wk10 小时前
自动化测试 - 文件上传 和 弹窗处理
开发语言·javascript·自动化测试·经验分享·爬虫·python·selenium
少云清11 小时前
【接口测试】4_Postman _全局变量和环境变量
测试工具·postman
卓码软件测评12 小时前
CMA/CNAS软件测评机构:【Gatling数据库性能关联测试JDBC连接和SQL执行时间监控】
数据库·sql·测试工具·性能优化·测试用例
mike041214 小时前
Eclipse+maven+selenium自动化测试用例入门
selenium·eclipse·maven
2501_924064111 天前
2025年接口错误自动分析工具对比与性能测试平台选型指南
测试工具·性能优化·数据可视化