Skip to content

Instantly share code, notes, and snippets.

@angiejones
Created October 31, 2020 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angiejones/060e21c9e30e7553c7fcb0780561782d to your computer and use it in GitHub Desktop.
Save angiejones/060e21c9e30e7553c7fcb0780561782d to your computer and use it in GitHub Desktop.
Get List of Relative Locators in Selenium 4
List<WebElement> relativeElements = driver.findElements(
withTagName("li").
toLeftOf(By.id("pid3")).
toRightOf(By.id("pid1"))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment