Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.7k points)

I want to get output that is a network panel on developer tools.[ Network panel--> Name,method,status,Type,Initiator,Size,Time,Timeline] I need this information.

1 Answer

0 votes
by (62.9k points)

This is possible using Selenium WebDriver. For this you should do the following:

  1. Download selenium language-specific client drivers from - and add appropriate jar files to your project build path.

  2. To run a test with Chrome/Chromium you will also need chrome driver binary which you can download from -

  3. Create a test case like this:


 // specify the path of the chromedriver binary that you have downloaded (see point 2)

    System.setProperty("", "/root/Downloads/chromedriver");

    ChromeOptions options = new ChromeOptions();

    // if you like to specify another profile



    DesiredCapabilities capabilities =;

    capabilities.setCapability(ChromeOptions.CAPABILITY, options);

    WebDriver driver = new ChromeDriver(capabilities);


    String scriptToExecute = "var performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {}; var network = performance.getEntries() || {}; return network;";

    String netData = ((JavascriptExecutor)driver).executeScript(scriptToExecute).toString();

Executing javascript on Chrome/Chromium will be helpful as it will give you the networking information also. The resulting string 'netData' will contain the required data in the JSONArray format.

I hope this helps.

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s automation testing course!

Browse Categories