lundi 5 août 2019

TestCafe ClientFunction TypeError error as document is undefined

I can successfully execute the following .click:

const clickMockContinueButton = ClientFunction(() => document.getElementsByName("paymentGatewayIframeReturnSubmit")[0].click())

by calling it with:

await clickMockContinueButton();

But even after the successful .click I get a TypeError:

An error occurred in ClientFunction code:

TypeError: document.getElementsByName(...)[0] is undefined

What am I doing wrong here?

Aucun commentaire:

Enregistrer un commentaire