Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
Cypress - how to access the button inside the iFrame located inside the shadow element

I have a problem where I can't access the button inside the iFrame located inside the shadow element.

Here is the HTML code:

<mati-frame>
    #shadow-root (open)
        <iframe>
            <button>
              Start
            </button>
        </iframe>
</mati-frame>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Not sure what you tried. I found the test was flaky depending on how the iframe was set up.

Mostly it failed to find the iframe's contentDocument, but turning off chromeWebSecurity seems to give consistent results.

cypress.json

{
  "chromeWebSecurity": false,
  "includeShadowDom": true
}

Test

cy.get('mati-frame')
  .find('iframe')
  .its('0.contentDocument.body')
  .find('button')                // passes
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!