Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Unable to set proxy via DesiredCapabilities in RemoteWebDriver #2051

Closed
lukeis opened this issue Mar 2, 2016 · 14 comments
Closed

Unable to set proxy via DesiredCapabilities in RemoteWebDriver #2051

lukeis opened this issue Mar 2, 2016 · 14 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 2051

As a user I would like to be able to configure Proxy Server settings on a remote machine
making use of the RemoteWebDriver. Currently when I try to perform this, I am confronted
with the following error

Proxy autodetect is incompatible with manual
settings

What steps will reproduce the problem?
When I am trying to configure Proxy server settings using the following code snippet

Proxy proxy = new Proxy();
proxy.setProxyAutoconfigUrl("http://localhost:8080/proxy.pac");
DesiredCapabilities capability = new DesiredCapabilities();
capability.setBrowserName(DesiredCapabilities.internetExplorer().getBrowserName());

capability.setCapability(CapabilityType.PROXY, proxy);
RemoteWebDriver d = new RemoteWebDriver(new URL("http://myhub:4444/wd/hub"),
capability);
Selenium s = new WebDriverBackedSelenium(d, "http://www.google.com"); 

I am being confronted with errors

What is the expected output? What do you see instead?
I should be able to couple Proxy object with DesiredCapabilities and then use it in
conjuction with RemoteWebDriver object and have a non Firefox browser such as IE, chrome
etc work with this proxy server.

Currently I understand that for browsers which dont work with profiles, such as IE,
chrome and safari, the proxy server settings should be done on an offline basis on
the machine and it cant be set from within the code.


Selenium version: *version: '2.0.0', revision: '12817', time: '2011-07-07 19:14:12'

OS: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_20'

Browser :IE 7 

I have verified this discrepancy only with IE and not tried this with Chrome and Safari
but I suspect that this should be the same with those browsers as well.


I have created a full fledged standalone java class that can help simulate this issue
on a consistent basis.

I have also included the output I obtained from the java class at hand and also the
complete stack trace for better troubleshooting and understanding the root-cause of
the problem.

Please refer to the gist at : https://gist.github.com/1080409

Reported by krishnan.mahadevan1978 on 2011-07-14 08:02:42

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I observe the same thing with Firefox if I use RemoteWebDriver instead of FirefoxDriver.
It gives me a “Proxy autodetect is incompatible with manual settings” error, even if
I try explicitly settig proxy.setAutodetect(false).

Reported by neuronexmachina on 2011-07-22 00:30:17

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by barancev on 2011-10-13 06:29:23

  • Labels added: Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Is this still a problem with the latest selenium release (2.19 as I write this)?

Reported by simon.m.stewart on 2012-02-20 21:58:28

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

yes it's still an issue, version 2.21.0

https://groups.google.com/group/webdriver/browse_thread/thread/7c526105bbcc2d40?hl=nl

Reported by rdekleijnaspider on 2012-04-24 18:18:09

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Simon,
You were right. I re-ran a quick test with firefox and chrome. I am indeed able to
make use of the Proxy class and couple it with RemoteWebDriver. The above thread mentioned
in Comment (4) contains an update on this by me. I am having some hiccups with IE however,
but I doubt if it has anything to do with RemoteWebDriver as such and is probably something
wrong at my end. Will dig further.

Reported by krishnan.mahadevan1978 on 2012-04-25 14:04:30

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

The thread which I updated with my latest findings : http://groups.google.com/group/webdriver/browse_thread/thread/7c526105bbcc2d40?hl=en

Reported by krishnan.mahadevan1978 on 2012-04-25 14:38:06

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

My issue is slightly different.
I want to use browsermob proxy within the GRID.

AND

I have to access my website over an external basic authenticated geo proxy. To simulate
traffic from other countries. This external proxy url will be slightly different per
country (e.g. de.p.geo.com:443 and be.p.geo.com:443 and so on)
How can I set the external proxy from my test ?

Reported by rdekleijnaspider on 2012-04-26 07:52:21

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

going on comment 7, and the GG message, this is now correct.

@rdekleijnaspider please ask on the user mailing list

Reported by david.burns@theautomatedtester.co.uk on 2012-05-05 21:05:01

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

http://stackoverflow.com/questions/24005252/python-using-proxybrowsermob-with-remote-webdriver

I feel like this issue isn't resolved V 2.42.00

Reported by ken88there on 2014-06-06 18:35:40

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

@ken88there: Please make sure the issue is not on the browsermobproxy side, retest with
 the version 2.0-beta-8

Reported by barancev on 2014-06-06 19:28:22

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Retested with version 2.0-beta-8. The results are the same as comment 10

Reported by ken88there on 2014-06-06 20:50:27

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Will this ticket be reopened?

Reported by ken88there on 2014-06-12 00:02:36

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

@ken88there: According to the description provided on SO you've got an error "proxy
refuses connections", that means that the proxy *is* set by selenium, but either the
proxy is not working properly or something inbetween blocks connections. That's why
this issue is not going to be reopened, Selenium is working as expected.

Reported by barancev on 2014-06-12 08:08:35

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:13:16

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant