Last active
August 29, 2015 14:17
-
-
Save wilsonmar/fa87d71a8f116dd5dc40 to your computer and use it in GitHub Desktop.
Selenium response time timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://qtpseleniumsudhakar.blogspot.com/2014/02/measuring-response-time-using-timer-in.html | |
// Get the Start Time | |
long startTime = System.currentTimeMillis(); | |
// Sample app: Open the BMI Calculator Mobile Application | |
driver.get("http://dl.dropbox.com/u/55228056/bmicalculator.html"); | |
// Wait for the Calculate Button | |
new WebDriverWait(driver, 10).until(ExpectedConditions. | |
presenceOfElementLocated(By.id("Calculate"))); | |
// WebElement ele = driver.findElement(By.id("ID of some element on the page which will load")); | |
long endTime = System.currentTimeMillis(); // Get the End Time | |
long totalTime = endTime - startTime; // Measure total time | |
System.out.println("Total Page Load Time: " + totalTime + "milliseconds"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add other element check