-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python Selenium 4.0.0 - Does not respect no_proxy variable but respects http_proxy and https_proxy #9925
Comments
Can confirm. I believe the problem is that The error I get when Selenium tries to communicate with the local web driver via the proxy is a "WebDriverException: A communication error occurred: Operation timed out." (Mentioning it here just for those who google for the error message). |
As a stop gap you can instantiate your own I will get that set if |
I was worried that might be the case. Since we're using urllib3, which weirdly seems to ignore proxy variables, I'm going to add in parsing and then use that for connections. @Cito do the URLs purely relate to driver start up? |
@AutomatedTester Yes, as far as I understand it is only used for the driver (which could be on a remote host system). For the browser, proxy configuration is done like this. And I think you're right, |
I know that browsers need it set differently, was just checking that there wasn't something in the middle, like grid, that we would need to deal with when trying to get I was going to borrow from those libraries |
@Cito I have an implementation ready to go that passes but I was wondering if you had examples from your setup that I could use as tests? |
Here is a complex one: |
cool, thanks, I have added these to test cases and things still look good. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
If people are setting no_proxy for certain values to get around the need to have a proxy for localhost, mostly, then we should set the poolmanager to proxymanager if not in no_proxy or poolmanager if it is. Fixes SeleniumHQ#9925 Fixes SeleniumHQ#9967
🐛 Bug Report
I upgraded python selenium 4.0.0 and when the tests run the request to the webdriver on localhost is sent to the proxy specified in environment variable https_proxy. The no_proxy variable is pecified to exclude
localhost
.To Reproduce
Run selenium tests inside the shell.
Requests to the webdriver on localhost is sent to the proxy even though no_proxy is defined.
When the reqeuest to localhost went to the proxy it was caught in the proxy protection solution and returned an erorr page that localhost is not categorized. :
The request shouldn't have been sent to the proxy in the first place.
Expected behavior
Both the values in http(s)_proxy and no_proxy should be respected.
This works in python selenium 3.141.0
Test script or set of commands reproducing this issue
Define environment variables in the shell:
Run your selenium test:
Environment
OS: Windows 10
Browser: Chrome
Browser version: 94.0.4606.71
Browser Driver version: ChromeDriver 94.0.4606.61
Language Bindings version: python selenium 4.0.0
The text was updated successfully, but these errors were encountered: