Open Browser fails after Keyword with Proxy Connection

348 views
Skip to first unread message

Rene Kirsch

unread,
Jan 3, 2013, 4:00:10 AM1/3/13
to robotframe...@googlegroups.com
Hello NG,

i wrote a little Robot Extension that Checks for Emails. To do that it opens a connection through our Company Proxy.
If i run these Keywords in a testcase everything is fine.
But following Tests fail at the Open Browser Keyword with 503 Service is not available Error (or several 403 Forbidden Erros).
After some time (10 minutes) the other Tests work correctly.

So...what the hell causes the Problem? The Proxy Connection?


Kevin O.

unread,
Jan 3, 2013, 11:48:12 AM1/3/13
to robotframe...@googlegroups.com
I'm thinking you have a proxy set in your OS. If no proxy environment variables are set, in a Windows environment, proxy settings are obtained from the registry’s Internet Settings section and in a Mac OS X environment, proxy information is retrieved from the OS X System Configuration Framework (http://docs.python.org/2/library/urllib2.html#urllib2.ProxyHandler).
On my system (Windows 7), requests to 127.0.0.1 get redirected to the proxy if it is set in Internet Options, including the request to create a Selenium session.
One way to tell urllib2 not to use a proxy when the communication is local is to set the environmental variable no_proxy. There are several ways to do this
1) As a keyword call to a bundled library:
OperatingSystem.Set Environment Variable no_proxy 127.0.0.1
2) In some Python code used by the test data:
import os
os.environ['no_proxy'] = '127.0.0.1'
3) in the shell/script prior to lanuching RF:
set no_proxy=127.0.0.1
export if *nix...

Whatever way its done, it has to happen before Open Browser.

Kevin
Reply all
Reply to author
Forward
0 new messages