Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created April 22, 2024 07:24
Show Gist options
  • Save SarahElson/1125e0436af9313ba6b33a1c6d24b474 to your computer and use it in GitHub Desktop.
Save SarahElson/1125e0436af9313ba6b33a1c6d24b474 to your computer and use it in GitHub Desktop.
How to Handle Shadow Root in Selenium Java
@Test
public void testNewMenuShadowRootElement() {
getDriver().get("https://www.htmlelements.com/demos/menu/shadow-dom/index.htm");
final HomePage homePage = new HomePage();
assertEquals(homePage.getNewMenuText(), "New");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment