Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If yes, how is it called, or where can I find more info about it? (I'm not talking about using WebDriverBackend.)

If not, what alternatives are there?

share|improve this question
    
I may eventually do that, but rather look for native webdriver solutions. – Roni Yaniv Jun 27 '11 at 11:26
    
Question has been answered, but many people on SQA cannot find answer to this problem, and are duplicating the question. Could we add more context to the question regarding the problem. For instance, this [sqa.stackexchange.com/questions/2915/… question) describes it very clearly and from more general perspective, IMHO. – dzieciou Nov 1 '12 at 7:50
up vote 14 down vote accepted

You can capture network traffic using a proxy, such as the BrowserMob Proxy (http://proxy.browsermob.com)

To configure the use of the proxy with a webdriver instance, set the CapabilityName.PROXY value to a org.openqa.selenium.Proxy instance:

Proxy proxy = new Proxy();
// The URL here is the URL that the browsermob proxy is using
proxy.setHttpProxy("localhost:9100");

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(CapabilityType.PROXY, proxy);

WebDriver driver = new FirefoxDriver(capabilities);

Once the test is finished, you can extract the data from the browsermob proxy using the mechanisms it provides. Notice that you can also use any proxy you want: it need not be the browsermob one!

share|improve this answer
    
Does using a proxy slow down the test? – A.J May 16 '12 at 19:57
    
and then how do you check the value from the proxy in the test? ...yet another whole system to maintain and to add false positives. – gcb Oct 26 '12 at 23:08

No there is no native solution at the moment. If you use webDriverBackedSelenium you can try to utilise the captureNetworkTraffic functionality, however there were issues with it last time I heard it talked about (See here for more info - https://groups.google.com/d/topic/selenium-users/fMSHeH9ZVqU/discussion).

It's also worth noting that captureNetworkTraffic only works in FireFox due to the way it was implemented so it's not a cross browser solution.

*Update*

Based on some information that came through the selenium/webdriver mailing lists you can use a proxy instead (Suggested one is http://bmp.lightbody.net/, although there are others).

To configure it:

 Proxy proxy = new Proxy();
 proxy.setHttpProxy(<proxyAddress>);
 DesiredCapabilities cap = DesiredCapabilities.firefox();
 cap.setCapability(CapabilityType.PROXY, proxy);
 WebDriver driver = new FirefoxDriver(cap);

This should currently work for FireFox and IE. It looks like this is going to be the way to capture network traffic moving forward.

Note: "new Proxy()" - Needs org.openqa.selenium.Proxy.

share|improve this answer

Haven't looked through it all yet, but I did find a post that seems related. Also, haven't tried it out, but, have you looked at any of the fiddler libraries? Although I have plans on trying them out, it's not going to be for a few months yet.

share|improve this answer
    
Looks interesting, but I'm looking for a more complete solutions, maybe requiring the usage of two tools (like selenium and gson, in my case). This looks like a lot of work to accomplish this thing. – Roni Yaniv Jun 27 '11 at 11:25

Yes you can automate it using BrowserMob Proxy. [Please use the below mentioedn link to test Network traffic using BrowserMob Proxy

https://keshavtechinfo.wordpress.com/web-automation/selenium/web-page-load-testing-using-selenium-and-browsermob-proxy/ ]1

share|improve this answer
1  
How about writing the answer here and using the link as reference? – TESTasy Jun 13 at 8:00
    
Using BrowserMob Proxy, we capture performance data How to use BrowserMob Proxy? Download BrowserMob Proxy 2.Start BrowserMob Proxy Create a new Project and import BrowserMob Proxy with Selenium Standalone Server Jar Run the script. After running the script, you will see the proxy server is started, and respective logs are generated. As the script stops, an HTTP achieve file is also generated with Performance Log of the desired web application. Now you can import that HAR file and see the results at pcapperf.appspot.com. It will show the fetched performance data. – kkashyap1707 Jun 14 at 5:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.