O'Reilly logo

Selenium 2 Testing Tools Beginner's Guide by David Burns

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – capturing network traffic

Imagine that you wanted to see if there was anything on the page that was not found. This could be images, CSS files, or JavaScript files. These things are not visible when working with a page, and it can be interesting with unexpected bugs. We will now see how we can create a HAR file and then capture it.

Since the HAR will return the JSON we need, we just need to parse the JSON returned to get what we want.

  1. Using the project we created previously, we are going to add a few more lines to get what we want.
  2. We need tell Selenium WebDriver that we have a proxy that it has to use. We do that with:
    FirefoxProfile profile = new FirefoxProfile();
    profile.setProxy(proxy.seleniumProxy);
  3. We need to tell the proxy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required