Skip to content

Instantly share code, notes, and snippets.

@ultimate-qa2
Last active February 15, 2021 05:37
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 ultimate-qa2/13415ac6cfd299b42d0d00bf1854dd71 to your computer and use it in GitHub Desktop.
Save ultimate-qa2/13415ac6cfd299b42d0d00bf1854dd71 to your computer and use it in GitHub Desktop.
Scrolling to a specific element using JS executor
public void scrollToElement(WebElement myElement) {
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);",myElement);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment