Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created April 22, 2024 07:23
Show Gist options
  • Save SarahElson/c388336ee90da93af5d22504a20a5d9f to your computer and use it in GitHub Desktop.
Save SarahElson/c388336ee90da93af5d22504a20a5d9f to your computer and use it in GitHub Desktop.
How to Handle Shadow Root in Selenium Java
public String getNewMenuText() {
openFileMenu();
return fileMenu().findElement(By.cssSelector(".smart-menu-drop-down div smart-menu-item.smart-element"))
.getAttribute("label");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment