selenium启动firefox浏览器时报 incorrect JSON status mapping for unknown error (500 expected)

首先,感谢https://blog.csdn.net/wjcaolinghua/article/details/82699749分享。

1、学习自动化测试时,用selenium启动firefox浏览器时,报 incorrect JSON status mapping for 'unknown error' (500 expected)。说实话,对这个错误不是很理解,网上搜了一下,说是驱动版本和firefox浏览器版本不匹配。

2、解决方法:去https://github.com/mozilla/geckodriver/releases下载匹配的版本,下图是最新的版本,而且支持大于等于60的浏览器版本,于是下载下来看下。(本机浏览器是76.0)

selenium启动firefox浏览器时报 incorrect JSON status mapping for unknown error (500 expected)

selenium启动firefox浏览器时报 incorrect JSON status mapping for unknown error (500 expected)

3、重新运行程序后,是正常的。