Cypress Studio cannot record interactions inside Shadow DOM, but Cypress tests can still test those elements. Use Studio to record the supported parts of an end-to-end flow, save the spec, and add a Cypress query with .shadow() or includeShadowDom: true. The Cypress Studio guide lists “iFrames and Shadow DOM are not supported” as limitations; that applies to Studio recording, not to Cypress’s documented Shadow DOM commands.
What Studio can and cannot do
Studio helps create and extend end-to-end tests by recording supported interactions, including clicks, typing, checks, unchecks, and selections. It saves changes to the spec file and supports inline editing. Its current guide lists iFrames and Shadow DOM as unsupported for recording. Cypress Studio documentation
So, use Studio for the parts of the page it can record, then edit the spec to add the Shadow DOM query yourself. This is a practical workflow based on Studio’s recording and editing capabilities; Cypress does not describe it as a prescribed recipe. Cypress Studio is for E2E tests; the guide also lists Component Testing, Cucumber-style tests, and recording across multiple origins as unsupported.
Choose a Cypress query for the shadow element
Use .shadow() to traverse a known component
When you know the shadow host, select it first, traverse into its open shadow root, and find the target within that root:
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
cy.get('checkout-panel').shadow().find('button').click()
.shadow() must be chained from a DOM element that is a shadow host. It yields that host’s shadow root, so you can continue with Cypress commands such as .find() and .click(). Cypress retries while waiting for the element and shadow root, as well as chained assertions. Cypress .shadow() API
Replace checkout-panel with the actual host selector and narrow button to the intended control when a component contains more than one button.
Rank #2
Use includeShadowDom when the query should search across shadow boundaries
For a selector that should search through Shadow DOM, pass the option to the query:
cy.get('.shadow-button', { includeShadowDom: true }).click()
The option can be set for an individual query. Cypress also documents a configuration option to enable Shadow DOM searching more broadly. Choose the configuration route when that behavior is appropriate across queries, rather than adding the option only where needed. Cypress cy.get() API
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Rank #3
| Approach | What it does | Useful when |
|---|---|---|
.shadow() |
Explicitly traverses from a selected host into its shadow root. | The test targets a particular component and you want the host-to-element path to be clear. |
includeShadowDom: true |
Includes Shadow DOM in the query’s search. | You want a query to search across shadow boundaries without explicitly traversing a particular host first. |
Selectors must still identify the intended element. Cypress documents both APIs, but does not prescribe one method for every component.
Add the command to a Studio-created spec
- Open Cypress in open mode and start a test, or use Studio to extend an existing E2E test. Cypress Open Mode guide
- Record the supported interactions around the Shadow DOM element, such as navigating to the page and interacting with ordinary page controls.
- Save the test so Studio writes its changes into the spec file.
- Edit the spec inline or in your editor, adding the appropriate
.shadow()orincludeShadowDomquery where the Shadow DOM interaction belongs. - Run the spec and inspect the Command Log and snapshots if the query or click does not behave as expected.
Studio recording and Cypress’s command API are separate capabilities: Studio cannot record Shadow DOM interactions, while Cypress documents commands for traversing or searching Shadow DOM.
Rank #4
Requirements and important limits
- The Studio guide says Studio requires internet access and sourcemaps.
- Studio AI has additional prerequisites: Cypress 15.11.0 or later and a Cypress Cloud account with a linked project. These apply to Studio AI’s assertion recommendations, not to manually adding the Cypress commands shown above.
- The documentation cited here does not establish whether Studio can record closed Shadow DOM roots. The examples describe Cypress query APIs and should not be taken as proof of Studio recording support or closed-root compatibility.
Troubleshoot common failures
The query finds no element
- With
.shadow(), confirm that the selector before it resolves to the actual shadow host. The command must be chained from a host, not from an element inside the component. - Check that the selector after
.shadow()matches an element inside that component’s root. - If you are using
includeShadowDom, verify that it is passed to the query that needs it, or that the relevant Cypress configuration is enabled. - Check whether the page has loaded the component and created its shadow root before the query runs. Cypress retries while waiting for the element, root, and chained assertions, but the selector still needs to match the page’s DOM.
A click behaves ambiguously in Chrome
Cypress documents a Chrome click issue after traversing a shadow root and lists .click('top') as a possible workaround. If the click is the failing step, try:
cy.get('checkout-panel').shadow().find('button').click('top')
Use this only when it addresses the observed click behavior; it does not change Studio’s recording limitation.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsOr skip the browser setup:
If your goal is to capture a website image or PDF rather than test a Shadow DOM interaction, ScreenshotNeo provides a one-request screenshot API. It is not a Cypress substitute and does not test or click Shadow DOM elements. For a screenshot, the cURL call is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for the API details. Before capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo to get 1,000 free screenshots a month with no card.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →




