Current state of setting Firefox proxy via DesiredCapabilities

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Current state of setting Firefox proxy via DesiredCapabilities

Kendall Schmidt
I've searched through the various Selenium/GeckoDriver issues and it is not clear to me the state of being able to set a proxy via DesiredCapabilities for Firefox. I'm hopefully someone in this group can provide some clarity.

I'm currently use the following:

Selenium v3.3.1 (Java bindings)
Firefox v52.0.2
GeckoDriver v0.15.0

Prior, with Selenium v3.0.1 (and an older version of GeckoDriver - maybe v0.11.0 or v0.12.0?), I could successfully set a proxy in Firefox using DesiredCapabilities. At that time I had to do so by finagling it a bit by setting the key "requiredCapabilities" in the DesiredCapabilities object to the proxy as an Object, as such:

Object proxy = new JsonParser().parse("{proxy:{" +
 
"proxyType:" + Proxy.ProxyType.MANUAL + "," +
 
"httpProxy:\"" + host + "\"," +
 
"httpProxyPort:" + port + "," +
 
"sslProxy:\"" + host + "\"," +
 
"sslProxyPort:" + port + "," +
 
"ftpProxy:\"" + host + "\"," +
 
"ftpProxyPort:" + port + "," +
 
"socksProxy:\"" + host + "\"," +
 
"socksProxyPort:" + port +
 
"}}").getAsJsonObject();
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities
.setCapability("requiredCapabilities", proxy);

Prior to Selenium v3.x (ie. v2.x) I simply did:

capabilities.setCapability(CapabilityType.PROXY, org.openqa.selenium.Proxy);

Today I noticed with Selenium v3.3.1 and GeckoDriver v0.15.0 the proxy is not being set anymore in Firefox nor is there any error.

Selenium/GeckoDriver issues have been closed indicated all is resolved so I no longer need to do the "requiredCapabilities" hokie-pokie, but obviously I'm missed some important change that I need to make on my end.

Does anyone know what I need to change?

Thanks,
Kendall

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/f4014fc8-3f8f-4479-a264-fa83f9593824%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.