I’m attempting to carry out e2e tests using Cypress for a payment page application.
I am able to target the iframe
, but in doing so, the body
becomes empty.
This is what I have done:
cy.get(`iframe[title="Iframe for ${field}"]`).its('0.contentDocument.body').should('be.visible').then(cy.wrap)
And then chain methods to it, e.g. .find('input')
.
The interesting thing is, I can type into the the input fields without using Cypress. However, I get the below error later and when trying to target the input field:
One or more securedFields has just loaded new content. This should never happen. securedFields have been removed. iframe load count=${x}. Expected count:${y}
Where x and y are numbers (have omitted deliberately).
I’ve yet to find any documentation on this. Would really appreciate any advice