Skip to main content

shadow$

Access an element inside a given element's shadowRoot. If you are working with lots of nested shadow roots, an alternative approach to shadow$ is to use the deep selector.

Usage
$(selector).shadow$(selector)
Parameters
NameTypeDetails
selectorString, Functionselector or JS Function to fetch a certain element
Example
shadow$$.js
it('should return an element inside a shadowRoot', async () => {
const innerEl = await $('custom-component').shadow$('#innerEl');
console.log(await innerEl.getValue()); // outputs: 'test123'
});

Welcome! How can I help?

WebdriverIO AI Copilot