最新版本的selenium和firefox的错误请求问题

时间:2015-06-30 06:47:26

标签: firefox selenium selenium-webdriver phpunit headless-browser

我正在开发用于无头Firefox的浏览器自动化的phpunit-selenium。我将selenium和Firefox更新到最新版本。它开始为我抛出错误。

“PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Bad request“

现在我用Google搜索,发现此问题与主机文件有关:

Unable to call FirefoxDriver constructor

https://code.google.com/p/selenium/issues/detail?id=3280

但由于应用程序限制,我无法更新hosts文件。有没有其他方法来解决这个问题?

1 个答案:

答案 0 :(得分:0)

修改个人资料应为您解决问题。

请注意,这是一个Java代码片段,您必须使用php API执行类似操作:

   profile.setPreference(FirefoxProfile.ALLOWED_HOSTS_PREFERENCE,"set.myhost.com");