-1

I want to calculate the finish time which we get in the Network Tab/Panel of Firefox ? Any API or any approach used for calculating it is appreciated. Finish time and not only load time. Finish Time as shown in the image

DJSam
  • 9
  • 3
  • Possible duplicate of [how to access Network panel on google chrome developer tools with selenium?](https://stackoverflow.com/questions/20401264/how-to-access-network-panel-on-google-chrome-developer-tools-with-selenium) – JeffC Sep 16 '17 at 01:40

1 Answers1

0

This can be accomplished by the difference between navigation start and load event end:

from selenium import webdriver

driver = webdriver.Firefox()
driver.get('https://stackoverflow.com')
load_time = driver.execute_script('return performance.timing.loadEventEnd - performance.timing.navigationStart;')

This will give you the load time in milliseconds

Dalvenjia
  • 1,953
  • 1
  • 12
  • 16
  • the given code will help me to calculate the load time and not the finish time. You can refer this link to clear the difference between load time and finish time https://stackoverflow.com/questions/30266960/website-response-time-difference-between-load-and-finish – DJSam Sep 18 '17 at 18:51