From
https://medium.com/rate-engineering/a-guide-to-working-with-shadow-dom-using-selenium-b124992559f
async function getExtShadowRoot() { let shadowHost; await (shadowHost = driver.findElement(By.css(CSS_SHADOW_HOST))); return driver.executeScript("return arguments[0].shadowRoot", shadowHost);}async function findShadowDomElement(shadowDomElement) { let shadowRoot; let element; await (shadowRoot = getExtShadowRoot()); await shadowRoot.then(async (result) => { await (element = result.findElement(By.css(shadowDomElement))); });
return element;}
No comments:
Post a Comment