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

● 成功:

● 项目背景:

相关推荐
学习中.........3 小时前
JVM 垃圾回收核心技术、演进全景与生产调优规范
java·jvm·测试工具
测试199813 小时前
软件测试 - 单元测试总结
自动化测试·软件测试·python·测试工具·职场和发展·单元测试·测试用例
影sir16 小时前
Selenium常用函数(等待)
selenium·测试工具
影sir16 小时前
Selenium常用函数(浏览器导航,文件上传,浏览器参数设置)
selenium·测试工具
WL_Aurora1 天前
Python爬虫实战(七):Selenium自动化采集苏宁易购商品数据
爬虫·python·selenium
德思特2 天前
通过 Wireshark 抓取串口命令
网络协议·测试工具·wireshark
影sir2 天前
Selenium常用函数(窗口与弹窗)
selenium·测试工具
Luminbox紫创测控2 天前
基于环境舱的新能源汽车三高试验方法与热响应评估
大数据·人工智能·测试工具·汽车·安全性测试·测试标准
菠萝猫yena3 天前
【读书笔记】《测试架构师修炼之道》读书笔记
功能测试·测试工具·单元测试