Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created July 31, 2020 17:56
Show Gist options
  • Save seleniumgists/04ae5289bb56140113e71690bfefec8c to your computer and use it in GitHub Desktop.
Save seleniumgists/04ae5289bb56140113e71690bfefec8c to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
WebDriver driver = WebDriverRunner.getWebDriver();
JavascriptExecutor js = (JavascriptExecutor) driver;
WebElement shadowDom = (WebElement) js.executeScript("return arguments[0].shadowRoot", driver.findElement(By.tagName("webview")));
WebElement iframe = shadowDom.findElement(By.tagName("iframe"));
driver.switchTo().frame(iframe);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment