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位置,根据你自己的情况而定!

● 成功:

● 项目背景:

相关推荐
llilian_164 小时前
信号发生器 多通道多功能脉冲信号发生器应用解决方案 多功能脉冲发生器
功能测试·单片机·嵌入式硬件·测试工具
程序员小远5 小时前
使用Postman进行一次完整的接口测试
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
我的xiaodoujiao6 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 44--将自动化测试结果自动推送至钉钉工作群聊
前端·python·测试工具·ui·pytest
生活很暖很治愈7 小时前
GUI自动化测试[3]——控件&数鼠标操作
windows·python·功能测试·测试工具
我的xiaodoujiao9 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 45--生成项目需要的requirements.txt依赖文件
python·学习·测试工具·pytest
uyeonashi10 小时前
Boost搜索引擎测试报告
功能测试·selenium·搜索引擎
@zulnger12 小时前
selenium 自动化测试工具实战项目(订单)
selenium·测试工具·自动化
深圳博众测控1 天前
博众测控 | ISO 16750-2:2023汽车电气测试新标准解读:关键变化与测试设备选型
人工智能·测试工具·汽车
测试界的世清1 天前
金九银十软件测试面试题(800道)
测试工具·面试·职场和发展
帝落若烟1 天前
loadrunner {“msg“:“请求访问:/getInfo,认证失败,无法访问系统资源“,“code“:401}
测试工具·压力测试