无法解析org.openqa.selenium.WebDriverException:指定的firefox二进制位置不存在或不是真实文件?

无法解析org.openqa.selenium.WebDriverException:指定的firefox二进制位置不存在或不是真实文件?,firefox,amazon-web-services,Firefox,Amazon Web Services,当我们通过linux运行selenium web驱动程序代码时,出现“org.openqa.selenium.WebDriverException:指定的firefox二进制位置不存在或不是真实文件:/usr/local/bin/firefox/firefox”异常 配置: aws cli/1.7.38 Python/2.7.9 Linux/3.14.48-33.39.amzn1.x8664 亚马逊弹性豆茎 已经在/usr/local/bin/firefox/firefox上安装了firefox

当我们通过linux运行selenium web驱动程序代码时,出现“org.openqa.selenium.WebDriverException:指定的firefox二进制位置不存在或不是真实文件:/usr/local/bin/firefox/firefox”异常

配置: aws cli/1.7.38 Python/2.7.9 Linux/3.14.48-33.39.amzn1.x8664 亚马逊弹性豆茎

已经在/usr/local/bin/firefox/firefox上安装了firefox

当我运行firefox版本时,控制台上会清楚地显示该版本

Mozilla Firefox 38.1.0

File pathToBinary = new File("/usr/local/bin/firefox/firefox");
FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
fBinary.setEnvironmentProperty("DISPLAY", ":1");
FirefoxDriver driver = new FirefoxDriver(ffBinary,pro);
xvfb已经启动。(Xvfb:1-屏幕0 1280x768x24)


请帮助我解决此问题?

此问题是由于selenium库和firefox版本冲突问题造成的