Robot Framework using Selenium2Library running a small script on IE browser with Proxy settings.

1,930 views
Skip to first unread message

Venu Singarapu

unread,
Jun 14, 2014, 3:29:41 AM6/14/14
to robotframe...@googlegroups.com
Hi,

I am using a proxy for my IE browser. I want to run the Robot Framework script.
Please let me know how do I use proxy information in the script.

Note: For firefox am able run the script by creating a new firefox profile.

Regards,
Venu.

Kevin O.

unread,
Jun 15, 2014, 12:14:21 PM6/15/14
to robotframe...@googlegroups.com
It is much easier if you can just change the system proxy settings, this must not be an option for you.
I'm assuming you are using a local webdriver (not using the standalone server or Grid).
By setting the proxy, IEDriverServer will temporarily change the system proxy. When this happens, Selenium's traffic between the client and driver server will be routed through the proxy, which is a problem when a non-local proxy server is sent a loopback address. To prevent that, you can set the environmental variable no_proxy.
By changing the default desired capabilities, all future IE sessions will use the proxy until the interpreter exits. It will work for local and remote webdrivers, but if you are using the remote webdriver, it could be made simpler.

Proxy Test
    Set Environment Variable    no_proxy    127.0.0.1
    ${proxy}=    Set Variable    myproxyserver:8888
    ${proxy dict}=    Create Dictionary    httpProxy    ${proxy}    ftpProxy    ${proxy}    sslProxy
    ...    ${proxy}    noProxy    127.0.0.1    proxyType    MANUAL    class
    ...    org.openqa.selenium.Proxy    autodetect    ${False}
    ${default IE caps}=    Evaluate    sys.modules["selenium.webdriver"].DesiredCapabilities.INTERNETEXPLORER    sys,selenium.webdriver
    Set To Dictionary    ${default IE caps}    proxy    ${proxy dict}
    Open Browser    http://www.github.com/    ie
    [Teardown]    Close All Browsers

Venu Singarapu

unread,
Jun 16, 2014, 3:31:42 AM6/16/14
to robotframe...@googlegroups.com
Hi Kevin,

thankyou for the valuable information.

My machine under client network so I can able to launch my applciation using proxy only. So I see this problem and I cannot disable to proxy.
Here am using local IEDriverServer for my scripts and am not using any Remote Webdriver also.

Please let me know how should I load and run the script using my proxy with the code when executing the script.

Thanks & Regards,
Venu

Rene Kirsch

unread,
Jun 16, 2014, 5:05:18 AM6/16/14
to robotframe...@googlegroups.com
I installed Proxifier to solve Proxy Problems. You can create Rules per Application to change Proxy Settings "on the Fly".

Venu Singarapu

unread,
Jun 16, 2014, 7:07:24 AM6/16/14
to robotframe...@googlegroups.com
Thanks Rene Kirsch for the information,

but unfortunately its restricted to use in our network.

Kevin O.

unread,
Jun 16, 2014, 10:24:50 AM6/16/14
to robotframe...@googlegroups.com
If you already have the system proxy settings set correctly (Internet Options), then all you should have to do is prevent Selenium's local traffic from being routed through the proxy. Here is one way to do it, and it must be done before Open Browser or Create Webdriver is called.

Venu Singarapu

unread,
Jun 18, 2014, 8:59:06 AM6/18/14
to robotframe...@googlegroups.com
Thanks Kevin,
let me try this way.

Venu Singarapu

unread,
Jun 23, 2014, 6:57:54 AM6/23/14
to robotframe...@googlegroups.com
Hi Kevin,
I observed one thing here is that when I disable all the proxy options(Automatic Configuration and Proxy Server option) in IE settings tab and execute the script application is launching properly(With-out any statements like set environment variable no_proxy 127.0.0.1).

And even if I try set environment variable to no proxy also script is not opening the application.

Kevin O.

unread,
Jun 23, 2014, 9:01:59 AM6/23/14
to robotframe...@googlegroups.com
One thing to check is that you haven't left an instance of IEDriverServer.exe running in the background. It will interfere with the start of a new test, but not consistently.
Message has been deleted

Venu Singarapu

unread,
Jun 30, 2014, 2:04:58 AM6/30/14
to robotframe...@googlegroups.com
Hi Kevin,

I verified that No IEDriverServer.exe instances are running in my machine.
Reply all
Reply to author
Forward
0 new messages