How to Find Out How Much Time Taken Open Website Using Java Selenium?

Time Taken Open Website Selenium WebDriver Program

How to Find Out How Much Time Taken Open Website Using Java Selenium?

When you are doing automation for a web application then you may face a common problem which is most of the time your website is opening lately.

public class open_time
{
   long start = System.currentTimeMillis();
   driver.get("Some url");
   long finish = System.currentTimeMillis();
   long totalTime = finish - start; 
   System.out.println("Total Time for page load::+totalTime)
}

Avatar for Softwaretestingo Editorial Board

I love open-source technologies and am very passionate about software development. I like to share my knowledge with others, especially on technology that's why I have given all the examples as simple as possible to understand for beginners. All the code posted on my blog is developed, compiled, and tested in my development environment. If you find any mistakes or bugs, Please drop an email to softwaretestingo.com@gmail.com, or You can join me on Linkedin.

Leave a Comment