giorgiosironi / phpunit-selenium

Selenium RC integration for PHPUnit
http://www.phpunit.de/
Other
601 stars 271 forks source link

PHPUnit-Selenium FirefoxProfile settings #348

Open deepseerha opened 9 years ago

deepseerha commented 9 years ago

I am getting a "Bad request" exception when starting a test run with Selenium WebDriver in Firefox. I traced this problem to hosts config file (using Linux). The hosts file on my machine has this line

127.0.0.1 something localhost

This works fine when I update hosts file as below

127.0.0.1 localhost something

But I cannot change this file. I found an issue related to this,

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

People suggested solution for this as

profile.setPreference(FirefoxProfile.ALLOWED_HOSTS_PREFERENCE, "something");

Can you please let me know how we can fix this issue with phpunit-selenium framework ?

giorgiosironi commented 9 years ago

I think this kind of information has to be passed inside the desidered capabilities when you create a new session: https://github.com/giorgiosironi/phpunit-selenium/blob/a6fdffdd56f4884ef39e09a9c62e5e4eb273e42c/Tests/Selenium2TestCase/CustomDesiredCapabilitiesTest.php Here it is explained how with the Java API, but it should be the same by passing it with the REST API that phpunit-selenium uses to talk with the Selenium Server: http://stackoverflow.com/a/17032649