Wait for different elements in same config/job

How to wait for different elements while don’t get error TimeoutException, it would possible?

I’ve discovered that my result page change elements xpath depending on result, after search I found a only unique button that have the same class in both results, I can use to wait the page content load

/html/body/app-root/app-acompanhamento/div/button/span

/html/body/app-root/app-acompanhamento-validacao/app-excecao-simplificada/div/div[3]/button/span

The same button have different xpaths
But class is the same

Button code of fail page result:

<button _ngcontent-bnf-c124="" fxlayoutalign="end" mat-raised-button="" class="mat-focus-indicator botao secundario laranja mat-raised-button mat-button-base" style="place-content: stretch flex-end; align-items: stretch; flex-direction: row; box-sizing: border-box; display: flex;">
<span class="mat-button-wrapper"> Entendi </span>
<div matripple="" class="mat-ripple mat-button-ripple"></div>
<div class="mat-button-focus-overlay"></div>
</button>

Success with button

<button _ngcontent-ngc-c136="" mat-stroked-button="" class="mat-focus-indicator botao normal secundario laranja alinhado-botao botao-final mat-stroked-button mat-button-base" style="margin-top: 15px;">
<span class="mat-button-wrapper">Entendi </span>
<div matripple="" class="mat-ripple mat-button-ripple"></div>
<div class="mat-button-focus-overlay"></div>
</button>

How to call by wait element block?

The result is:

>> Wait for Element (PuppeteerWaitForElement) <<

Waited for element with Class mat-button-wrapper

>> Get DOM (PuppeteerGetDOM) <<

Got the full page DOM

Apparently everything is ok, but I can’t capture the keycheck because the data hasn’t loaded yet.
Maybe the button is loading first then data, so I still need wait different elements

Some trick to do it?

I was wondering if something like that can be possible:

IF the xpath A exists = wait for element A
IF the xpath B exists = wait for element B

For now I’m using delay block but I will certainly get problems in real job situation with connections problems

Thanks

BLOCK:PuppeteerExists
  findBy = XPath
  identifier = "your xpath here"
  => VAR @exists1
ENDBLOCK

IF BOOLKEY @exists1 Is True
// Wait for element here
END

Duplicate immediately below for the other one

1 Like

Nice I will try it now, thank you very much!

Hey, do you know why chrome doesn’t is closing?
Some days ago I was running job headless and 1 hour later I had so many chrome proccess that 32GB of ram wasn’t enough

I am running now with no headless mode to debug results with close browser block and it still don’t closing

image

image

Do you noticed something like this?

I found this:

The fact is that when your config gives a FAIL it doesn’t trigger the close browser block, you should go to config options and make it continue for all statuses so it executes the close browser block. If you want me to implement a way to always close the browser regardless, please open an issue on github and I will add it.

I was set FAIL as disapproved status, but when I set settings like that

image

The browser closes correctly but it is retrying over and over and over

image

Puppeteer is not a priority at the moment, eventually I will improve it but for now I have other priorities.