Cypress · Middle · Question 17 of 77

How do you interact with content inside an iframe in Cypress?

Show the answer

Correct answer: Get the iframe's body and wrap it, or use a plugin

Explanation

A common helper gets iframe.contentDocument.body, waits for it to be non-empty, then uses cy.wrap() to query inside.

Further reading

Problem with a question

Cypress · Middle · question 17

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz