четверг, 5 сентября 2013 г.

Python binding and proxy

If you have proxy set at your machine with Selenium sometimes you need to setup proxy not only for browser but for binding too.

Python binding uses default urllib/urllib2 libraries which read machine configuration and uses it for connection.

At least at Windows it reads "<scheme>_proxy" enviroment variables for proxy
and "no_proxy" or "NO_PROXY" for bypass addresses. Also it could read Windows Registry for IE proxy settings which are system defaults.

So if your grid is behind proxy or python could not connect even to local driver (see https://code.google.com/p/selenium/issues/detail?id=6213 as example) you need to setup either IE proxy settings or OS enviroment variables like http_proxy, no_proxy etc.