If statement in Puppeteer

Hi guys, how can I use an IF Statement in Puppeteer, for example if the config found a Failure KEY the browser should close while if it found a Success KEY the browser shall remain open?

Any hints for that guys?

@Ruri any help please?

IF STRINGKEY @data.SOURCE Contains "abc"
// Here put a browser close block
END

and in the settings of the config put that it shouldn’t close for SUCCESS/FAIL etc. since you’re already handling closing yourself. Also maybe tick “SAFE” on the browser open block since if it’s already open it might fail.

1 Like

I did as you said but I’m getting this error:

[Executing block CLICK-PROFILE] PuppeteerException: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the Page has been closed.Close reason: Target.detachedFromTarget

This is an issue with current version, I fixed it so wait until v 0.1.28 and it will work

1 Like

Oh okay that would be nice, appreciate your answers.