selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”

照着其他文档学习,练习Selenium第一个程序,如下:

selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”

之前报错找不到驱动,把Build Path 里的Selenium的jar包重新导入一下,就可以继续了。

之后又报错,如下:

selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”

“org.openqa.selenium.remote.ErrorCodes toStatus,HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected)”,这个错误是因为我们的浏览器驱动太低了和浏览器的版本不匹配。

Firefox驱动文件版本下载地址,请点击https://github.com/mozilla/geckodriver/releases

selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”

selenium启动报错“ incorrect JSON status mapping for 'unknown error' (500 expected)”

 

这会就ok了