0

In Chrome, I can open up the developer console and switch to the network tab to see what resources are being loaded and how long each one has taken. Is there anyway to access similar information from Chrome webdriver or selenium?

Ben McCann
  • 18,548
  • 25
  • 83
  • 101

2 Answers2

0

Please check my answer Reading & storing chrome Developer tool network data You can't do it through the dev tools, but you can have a proxy, capturing everything (with pretty nice bindings).

Another question is why do you need it?

Community
  • 1
  • 1
Stan E
  • 3,396
  • 20
  • 31
0

Take a look at Resource Timing javascript API. It is usually stored at performance variable in Chrome. Here is an interesting article about it. For example,

performance.getEntriesByType("resource").forEach(function(resource) {
    console.log(resource.name); console.log(resource.duration)
});

You can try to use WebDriver to execute this script and get timing results. But I thing actually you don't need WebDriver there. It's better to add some script like this to your page and get this data by proper and fast method.

Pazonec
  • 1,549
  • 1
  • 11
  • 35