Created
April 22, 2024 07:15
How to Handle Shadow Root in Selenium Java
This file contains 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 WebElement fileMenu() { | |
final WebElement shadowHost = getDriver().findElement(By.cssSelector(".smart-ui-component")); | |
final SearchContext shadowRoot = shadowHost.getShadowRoot(); | |
return shadowRoot.findElement(By.cssSelector(".smart-element .smart-menu-main-container .smart-element")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment