简体   繁体   中英

Bad request issue with latest version of selenium and firefox

I am working on phpunit-selenium for browser automation with headless Firefox. I updated both selenium and Firefox to latest version. And it started throwing error for me.

“PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Bad request“

Now I googled for this and found that this issue is related to hosts files:

Unable to call FirefoxDriver constructor

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

But I cannot update hosts file due to application restrictions. Is there another way to fix this?

Modifying the profile should resolve the issue for you.

Note that this is a Java code fragment, You would have to do something similar with the php API:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM