sauce_bindings icon indicating copy to clipboard operation
sauce_bindings copied to clipboard

PROXY not usable in Python Bindings > selenium 3.13.0

Open mdsauce opened this issue 5 years ago • 4 comments

Problem

Users on corporate/secure networks cannot start a remote webdriver session if they are required to use a proxy.

Impact

Highly regulated groups and corporate networks cannot use sauce labs if they use python and selenium >3.13.0.

Details

The Python Selenium bindings will NOT detect the environment variables for a Proxy. This includes HTTP_PROXY, HTTPS_PROXY, and any other environment variables used for proxy.

See this for details https://github.com/SeleniumHQ/selenium/issues/7247

Workaround

Users have been setting 3.13.0 in their requirements file for selenium. After that version the internal http library for Remote Webdriver connections started using urllib3 and introduced this problem: https://github.com/SeleniumHQ/selenium/issues/7247#issuecomment-499105071

@joshmgrant @nikolay-advolodkin This isn't anything except a heads up and public record of a known issue. You may already know this.

mdsauce avatar Feb 18 '20 18:02 mdsauce

@mdsauce this is something that is unique to Python? Is there something that works in Java that doesn't work in Python that maybe the Sauce Bindings can help with?

I don't proxy enough to know off hand what is going on with this.

titusfortner avatar Apr 17 '20 20:04 titusfortner

The Sauce Bindings should use python-selenium 3.13.0, otherwise users will hit a wall when they try to start a session and send the remote webdriver capabilities.

@titusfortner nothing especially unique to python, but with the current Python selenium bindings will ignore environment variables like HTTPS_PROXY and HTTPS_PROXY. This means users in larger orgs where internet access is impossible w/o a proxy can do one of two things:

  1. https://github.com/SeleniumHQ/selenium/issues/7247#issuecomment-499105071 Modify the file itself
  2. Use python's selenium 3.13.0
  3. define the proxy in their capabilities:
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
    "httpProxy":PROXY,
    "ftpProxy":PROXY,
    "sslProxy":PROXY,
    "noProxy":None,
    "proxyType":"MANUAL",
    "class":"org.openqa.selenium.Proxy",
    "autodetect":False
}

https://stackoverflow.com/questions/17082425/running-selenium-webdriver-with-a-proxy-in-python

The full fix is described here: https://github.com/SeleniumHQ/selenium/issues/7247#issuecomment-566947259

mdsauce avatar Apr 21 '20 01:04 mdsauce

@mdsauce do we have clients and/or open issues with this as a blocker?

titusfortner avatar Apr 21 '20 16:04 titusfortner

Yes, at least 1. Ticket was closed @titusfortner but I can email you the details.

mdsauce avatar Apr 22 '20 00:04 mdsauce