Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda