Skip to content

Commit

Permalink
added new method - scrollTillElementIntoView(WebElement element)
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbagmar committed Nov 11, 2024
1 parent 18c543d commit 662e92e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/znsio/teswiz/runner/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ public void scrollToBottom() {

public void scrollTillElementIntoView(By elementId) {
WebElement element = driver.findElement(elementId);
scrollTillElementIntoView(element);
}

public void scrollTillElementIntoView(WebElement element) {
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);
}

Expand Down

0 comments on commit 662e92e

Please sign in to comment.