Skip to content

Commit

Permalink
Action ScrollTo : Do not execute the last scroll if offset is not def…
Browse files Browse the repository at this point in the history
…ined.
  • Loading branch information
bcivel committed Dec 11, 2024
1 parent b926217 commit 1e6f576
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ private boolean scrollDown(TestCaseExecution testCaseExecution, By element, int
//Element found, perform another scroll to offset from middle of screen
int pressOffsetX = driver.manage().window().getSize().width / 2;
int pressOffsetY = driver.manage().window().getSize().height / 2;
if (hOffset==0 && vOffset==0){
if (hOffset!=0 && vOffset!=0){
scroll(driver, pressOffsetX, pressOffsetY, pressOffsetX - hOffset, pressOffsetY - vOffset);
testCaseExecution.addExecutionLog(ExecutionLog.STATUS_INFO, "[Action:ScrollTo] : Element "+element+" displayed. Applied the offset ("+hOffset+";"+vOffset+") scrolling from the coord("+pressOffsetX+";"+pressOffsetY+")");
} else {
Expand Down

0 comments on commit 1e6f576

Please sign in to comment.