How to measure page load time of a website using Selenium-Python?

0 votes
How to measure page load time of a website using Selenium-Python?
Jul 22 in Selenium by Damodar
741 views

1 answer to this question.

0 votes

Hello Damodar, following test script allows you to measure page load of a webpage using Selenium-Python:

from selenium import webdriver

hyperlink = "http://edureka.co"
driver = webdriver.Chrome()
driver.get(hyperlink)
 
navigationStart = driver.execute_script("return window.performance.timing.navigationStart")
responseStart = driver.execute_script("return window.performance.timing.responseStart")
domComplete = driver.execute_script("return window.performance.timing.domComplete")

backendPerformance_calc = responseStart - navigationStart
frontendPerformance_calc = domComplete - responseStart
 
print("Back End: %s" % backendPerformance_calc)
print("Front End: %s" % frontendPerformance_calc)
 
driver.quit()
answered Jul 22 by Anvi
• 13,960 points

Related Questions In Selenium

0 votes
1 answer

How to know the exact time to load a page using Selenium WebDriver?

Normally WebDriver should return control to your ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,430 points
1,573 views
0 votes
1 answer

How to upload a resume to a website using selenium in python?

Use this code, this will help you: from ...READ MORE

answered Apr 20, 2018 in Selenium by Vardy
• 2,270 points
1,106 views
0 votes
1 answer

How to get coordinates of a web element using Python Selenium?

Hey Ushma, you can use following code ...READ MORE

answered Jul 29 in Selenium by Abha
• 27,180 points
97 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 13,960 points
272 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
1,128 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,150 points
1,239 views
0 votes
1 answer