Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
How can I time a "Loading Screen" page on Jmeter/Selenium

After I upload a file to the website, the website showcases a loading screen. The loading screen is up depending on the size of the file. I would like to measure the duration of how long the loading page was up for. I am a beginner in jmeter and programming, so I do not know if there is a much better idea than the one that I currently have.

Here is what I got so far.

var node = implicitFind(pkg.By.xpath("//div[id]")); //xpath of the loading screen
var increment = 1;

while (node != null) {
    if (increment == 1) 
        var before = new Date().getTime(); //gets current time of test
    increment++;
}

var after = new Date().getTime();

WDS.log.info('------- Time taken for loading screen = ' + (after - before) + ' ms');

/*
  The reason why I added an increment was so the before time can be recorded only on the 
  first loop rather than every loop. The loop ends when xpath no longer exist, which is 
  when the after time is recorded. 
*/

The issue with this code is that jmeter never breaks the loop, even if condition is false. The xpath is from a text that shows up when the loading screen shows up. Please help if there is a better way or if there is a flaw with my current code. Thanks y'all!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

It's hard to say what's wrong without seeing your implicitFind function code, you might want to re-visit it and check for element visibility or invisibility i.e. use WebElement.isDisplayed() function

More information: The WebDriver Sampler: Your Top 10 Questions Answered

about 4 years ago · Juan Pablo Isaza Report

0

long startTime = System.currentTimeMillis();

driver.get("http://infoall.org");
new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.id("Calculate")));

long endTime = System.currentTimeMillis();
long totalTime = endTime - startTime;

System.out.println("Total Page Load Time: " + totalTime + "milliseconds");
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!