Resource Timing API not showing correct resources in Selenium

234 views Asked by At

I have geckodriver latest version installed and I am running latest Firefox version. I wrote a selenium script to just open a URL in firefox and keep the browser open (I am not calling driver.close() or driver.quit())

Here is what the script looks like

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.nrk.no/")

The number of resources reported by Resource Timing API is > 100 for this website. first Load of nrk.no trhough selenium

Now, the website is just reloaded again, so that the resources are fetched from cache. NOTE: I refreshed by just pressing enter in the address bar

The number of resources reported by Resource Timing API is < 40. Same is the discrepancy with the number of resources in Developer Tools in Networks tab. This is happening for every website.

second load of nrk.no

This is not happening if I just run plain Firefox and refresh the page in the same way. The resources number match always, irrespective of the number of times I refresh the web page.

0

There are 0 answers