Skip to main content

shadow$$

Overview

Use the shadow$$ command to access elements within the ShadowRoot of a given element.

Usage

await browser.$(selector).shadow$$(shadowSelector);

Command Parameters

NameTypeDescription
shadowSelectorString or FunctionSelector or JS function to get a specific element (or elements).

Usage Examples

it("should return elements inside a ShadowRoot", async ({ browser }) => {
const innerEl = await browser.$(".input").shadow$$("#innerEl");
console.log(await innerEl.getValue()); // outputs: 'test123'
});

References

We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.