operasoftware / operaprestodriver

OperaPrestoDriver is a vendor-supported WebDriver implementation that enables programmatic automation of Presto-based Opera products (i.e. v12 and older).
http://code.google.com/p/selenium/wiki/OperaDriver
Apache License 2.0
148 stars 65 forks source link

Using OperaDriver with proxy settings #68

Closed mexicano closed 11 years ago

mexicano commented 12 years ago

Hi,

how to start Opera via RemoteWebDriver with proxy settings?

this does not work

DesiredCapabilities cap = DesiredCapabilities.opera();
Proxy proxy = new Proxy();
proxy.setHttpProxy(proxyHost + ":" + proxyPort);
cap.setCapability(CapabilityType.PROXY, proxy);
RemoteWebDriver wd = new RemoteWebDriver(wdURL, cap);

and this too:

DesiredCapabilities cap = DesiredCapabilities.opera();
Proxy proxy = new Proxy();
proxy.setProxyAutoconfigUrl(proxyAutoconfig);
cap.setCapability(CapabilityType.PROXY, proxy);
RemoteWebDriver wd = new RemoteWebDriver(wdURL, cap);

Sergey

andreastt commented 12 years ago

Currently OperaDriver does not support using it via proxy. This is entirely because I haven't gotten around to implement it yet, so please feel free to submit a patch for this! (-:

lkende commented 12 years ago

I got around this issue by using setting values in the preferences file. (You might be able to set these in a profile first as well)

You can use Opera's preference editor, or what I did here was build my own preference editor... the commands below won't detail that piece but you can see the top-level area of the file [Proxy] and then the two fields that need to be set.

//auto proxy configuration url prefsEditor.setPref("Proxy","Use Automatic Proxy Configuration","1"); prefsEditor.setPref("Proxy","Automatic Proxy Configuration URL","http://url-of-proxy-pac");

andreastt commented 12 years ago

A very simple patch would be to set those preference directly after launch if they exist in the capabilities object in OperaDriver (-:

andreastt commented 11 years ago

OperaDriver 0.16 introduced support for Selenium's Proxy API.