我正在开发用于无头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文件。有没有其他方法来解决这个问题?
答案 0 :(得分:0)
修改个人资料应为您解决问题。
请注意,这是一个Java代码片段,您必须使用php API执行类似操作:
profile.setPreference(FirefoxProfile.ALLOWED_HOSTS_PREFERENCE,"set.myhost.com");