Skip to content

Commit

Permalink
Scroll to Element for APK/IPA : Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bcivel committed Jan 22, 2025
1 parent be2b76c commit a17e23a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ private boolean scrollDown(TestCaseExecution testCaseExecution, By element, int

//Element found, perform another scroll to put the element at the middle of the screen at the defined offset.
int distanceFromMiddleOfTheScreen = (driver.manage().window().getSize().height / 2) - driver.findElement(element).getLocation().getY();
testCaseExecution.addExecutionLog(ExecutionLog.STATUS_INFO, "[Action:ScrollTo] : Element " + element + " displayed. Coordinate : (" + driver.findElement(element).getLocation().getX() + ";" + driver.findElement(element).getLocation().getY() + "). Distance from the middle of the screen ("+distanceFromMiddleOfTheScreen+"px)");


if (distanceFromMiddleOfTheScreen > 0) {
scroll(driver, pressX, topY, pressX, topY + distanceFromMiddleOfTheScreen + vOffset);
Expand Down

0 comments on commit a17e23a

Please sign in to comment.