shadow$$
Overview
Use the shadow$$
command to access elements within the ShadowRoot of a given element.
Usage
await browser.$(selector).shadow$$(shadowSelector);
Command Parameters
Name | Type | Description |
shadowSelector | String or Function | Selector 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'
});
Related Commands
References
We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.