0

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.

skjindal93
  • 706
  • 1
  • 16
  • 34
  • I can add screenshots if the description is not good enough – skjindal93 Jul 17 '17 at 11:06
  • Can you help us with some captured data and the tools you have used for further analysis? Thanks – undetected Selenium Jul 17 '17 at 11:16
  • @DebanjanB I have added screenshots of my issue. Let me know if you need something else – skjindal93 Jul 18 '17 at 04:26
  • Tried to get `Resource Timing API` details as per your screenshot. But I am stuck. What I observe from your comment you may be pretty right. So what is your exact Question? Are you stuck any where particularly? How is `Resource Timing` impacting your Automated Test Execution? Thanks – undetected Selenium Jul 18 '17 at 05:10
  • I am running some tests where I want cached resources. The only way I guess to get cached resources is to reload the page using Selenium and run tests on them. Is there any other way I can cache resources and get away with this bug? – skjindal93 Jul 18 '17 at 05:13
  • Yup, you are right. PageFactory can improve the Performance of the Automated Test Execution too. Are you using POM? Thanks – undetected Selenium Jul 18 '17 at 05:15
  • No. I am just using plain Selenium and not using POM. I just need values from Resource Timing API and run tests on them – skjindal93 Jul 18 '17 at 05:17
  • I guess all these properties are Browser properties. You may consider configuring the WebDriver as per your requirement. Thanks – undetected Selenium Jul 18 '17 at 05:18
  • Thanks @DebanjanB. I will look into it – skjindal93 Jul 18 '17 at 05:23

0 Answers0