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

● 成功:

● 项目背景:

相关推荐
代码的乐趣44 分钟前
支持selenium的chrome driver更新到136.0.7103.94
chrome·python·selenium
深浅卡布星14 小时前
Postman启动时检测到版本不匹配错误
测试工具·postman
九章云极AladdinEdu18 小时前
GPU与NPU异构计算任务划分算法研究:基于强化学习的Transformer负载均衡实践
java·开发语言·人工智能·深度学习·测试工具·负载均衡·transformer
程序员小远20 小时前
UI自动化测试方案详解
自动化测试·软件测试·selenium·测试工具·ui·职场和发展·测试用例
JZMSYYQ1 天前
磁光克尔效应在量子计算中的应用
功能测试·测试工具·制造
逸雨清风2 天前
Chrome更新到136以后selenium等自动化浏览器失效
selenium·自动化
小白学大数据2 天前
Python+Selenium爬虫:豆瓣登录反反爬策略解析
分布式·爬虫·python·selenium
小冯的编程学习之路2 天前
【软件测试】:推荐一些接口与自动化测试学习练习网站(API测试与自动化学习全攻略)
c++·selenium·测试工具·jmeter·自动化·测试用例·postman
Ten peaches3 天前
Selenium-Java版(操作元素)
java·selenium·测试工具·html
傻小胖3 天前
三种常见接口测试工具(Apipost、Apifox、Postman)
测试工具·postman