Created
April 22, 2024 07:40
-
-
Save SarahElson/4a809b24aa8cc5c6e1fb03aa805f685f to your computer and use it in GitHub Desktop.
How to Handle Shadow Root in Selenium Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShadowRootTests extends BaseTest { | |
@BeforeClass | |
public void navigateToWebsite() { | |
getDriver().get("https://www.htmlelements.com/demos/menu/shadow-dom/index.htm"); | |
} | |
@Test | |
public void testFileMenuShadowRootElement() { | |
final HomePage homePage = new HomePage(); | |
assertEquals(homePage.getFileMenuText(), "File"); | |
} | |
@Test | |
public void testNewMenuShadowRootElement() { | |
final HomePage homePage = new HomePage(); | |
assertEquals(homePage.getNewMenuText(), "New"); | |
} | |
@Test | |
public void testEditMenuShadowRootElement() { | |
final HomePage homePage = new HomePage(); | |
assertEquals(homePage.getEditMenuText(), "Edit"); | |
} | |
@Test | |
public void testUndoMenuShadowRootElement() { | |
final HomePage homePage = new HomePage(); | |
assertEquals(homePage.getUndoMenuText(), "Undo"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment