Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

254
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda