How to get response from puppeteer?

Hey,

Im using puppeteer made config with buster its working great but i want to add if condition like if reset button detected then retry the solver function again here’s the details:

everything is working except PuppeteerExecuteJs block:

BLOCK:PuppeteerWaitForElement
  findBy = Selector
  identifier = "button[title='Reset the challenge']"
  timeout = 5000
ENDBLOCK

BLOCK:PuppeteerExecuteJs
  expression = "document.querySelector('button[title=\\\"Reset the challenge\\\"]') !== null"
  => VAR @resetButtonExists
ENDBLOCK

result i get:
image

This is the button element that im referring to:

<button class="rc-button" tabindex="0" title="Reset the challenge" id="reset-button"></button>

why its giving me false ? you can see its detect in wait for element

1 Like

Probably you’re switching the iframe and waiting for the element, but when you’re using Execute JS, the query is not valid and the iframe hasn’t been switched.

I added wait for element just for detection like its switching to iframe correctly, so how can i fix it?