Proxy Settings in Selenium

68 views
Skip to first unread message

sharanabasappa g

unread,
Mar 7, 2016, 2:23:00 AM3/7/16
to webd...@googlegroups.com

Dear Friends
  Why should we set proxy settings in Selenium scripts, I did Google a lot but come up with lot of confusion, could anyone can share their experience.

Krishnan Mahadevan

unread,
Mar 7, 2016, 3:49:05 AM3/7/16
to webdriver
You would need to use a Proxy setting under the following conditions

You are working in a CORPORATE network, wherein your browser needs a proxy server information through which all internet browsing requests will have to go through [ failure to do this, would deny browsing access ] and you are using Selenium to automate in this environment wherein your tests are opening up some URLs on the internet which have to go via the Proxy server.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Mon, Mar 7, 2016 at 12:52 PM, sharanabasappa g <shara...@gmail.com> wrote:

Dear Friends
  Why should we set proxy settings in Selenium scripts, I did Google a lot but come up with lot of confusion, could anyone can share their experience.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at https://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

sharanabasappa g

unread,
Mar 7, 2016, 5:26:29 AM3/7/16
to webd...@googlegroups.com

Dear Krishnan
      Thanks for valuable inputs.

darrell grainger

unread,
Mar 7, 2016, 9:24:48 AM3/7/16
to webdriver
In addition to a corporate requirement, if you understand how proxy servers work you might set up a proxy server which will record activity. Normally when you submit an HTTP request from a web browser it goes to the application server. The application server then returns an HTTP response. Pictorially this would be:

Web_Browser----------->Application_Server----------->Web_Browser

With a proxy server in the mix it would be:

Web_Browser----------->Proxy_Server----------->Application_Server----------->Proxy_Server----------->Web_Browser
You can then have software running on the proxy server which records the traffic or even modifies the packets as they pass thought the proxy server. For example, I could change the location of the web browser (geo-location testing), I can add headers to trigger A/B testing, etc. Bottom line however is if you don't know what I'm talking about, you probably don't need to do this... yet. :)

Mark Collin

unread,
Mar 11, 2016, 2:28:49 AM3/11/16
to webdriver
You can use inline proxies to do other things.  For example:

- Set JMeter up as a proxy to record a series of steps as a basis for a JMeter script.
- Set Selenium up to use a BrowserMob proxy so that you can track network traffic as you run your tests against a site, maybe even modify your network traffic (e.g. add basic auth headers).
- Set the ZAProxy up as a proxy so that it can learn about your site before performing a series of attacks against it (penetration testing).

I go through all of these in my book Mastering Selenium Webdriver

sharanabasappa g

unread,
Mar 11, 2016, 2:34:03 AM3/11/16
to webd...@googlegroups.com

Hi Mark
   Thanks for information.

--

张加林

unread,
Mar 11, 2016, 7:22:28 AM3/11/16
to webdriver
many reasons.
1, you can use a proxy to simulate a different network condition , such as a slow network.
2, you can record or modify  network traffic( in this case, http(s) traffic, you can specify some patterns to alter packet content ).
3, access contents available to restricted areas.( yeah, google groups is blocked in my place )

在 2016年3月7日星期一 UTC+8下午3:23:00,sharan写道:
Reply all
Reply to author
Forward
0 new messages