Enhancement #5078 - Allow :desired_capabilities capabilities to be speci...#8
Enhancement #5078 - Allow :desired_capabilities capabilities to be speci...#8kuahyeow wants to merge 1 commit intoSeleniumHQ:masterfrom
Conversation
…s to be specified for PhantomJS so that phantomjs.page.settings.* can be specified
The phantomjs.page.settings.* settings are passed in as part of the Capabilties object, so e.g. we now can change the user-agent like so:
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs("phantomjs.page.settings.userAgent" => "Custom Agent/1.0")
Selenium::WebDriver.for :phantomjs, :desired_capabilities => capabilities
|
Can I suggest to also implement https://github.com/detro/ghostdriver/blob/master/binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriverService.java#L250? This allows an array of string passed for Capability |
|
@kuahyeow: Thanks for this. Have you signed the CLA? http://goo.gl/qC50R I've thought about this for a while, and would eventually like to make the same change for all the drivers. @detro: I'll put that on the TODO as well. |
|
Cool ;)
|
|
So, urm. Do you want to implement for all drivers now, or later ? :) To cherry-pick some examples : Chrome, and opera can accept various arguments using |
|
I'd like to implement |
|
This won't be in 2.30 (which I need to get out for Firefox 19 support), but I'll get it into 2.31. |
|
I'm going to get this done and push 2.31 today. |
|
@kuahyeow I added a |
|
Thanks ! The As a workaround currently it works great. Of course I would prefer passing in port, etc just like FirefoxDriver :) |
|
Right. In case it wasn't clear, since 2.31 you can: caps = Selenium::WebDriver::Remote::Capabilities.phantomjs(
"phantomjs.page.settings.userAgent" => "Custom Agent/1.0"
)
driver = Selenium::WebDriver.for :phantomjs, :port => 1111, :desired_capabilities => caps |
|
@jarib Brilliant, upgrading to 2.31 now |
|
Thanks @jarib solved. |
...fied for PhantomJS so that phantomjs.page.settings.* can be specified
The phantomjs.page.settings.* settings are passed in as part of the Capabilties object, so e.g. we now can change the user-agent like so:
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs("phantomjs.page.settings.userAgent" => "Custom Agent/1.0")
Selenium::WebDriver.for :phantomjs, :desired_capabilities => capabilities