Skip to content

Commit

Permalink
Fix scrollDown action not working properly when element present but n…
Browse files Browse the repository at this point in the history
…ot displayed
  • Loading branch information
bcivel committed Mar 21, 2024
1 parent 0b293b4 commit bc69fea
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,12 @@ private boolean scrollDown(AppiumDriver driver, By element, int numberOfScrollDo

do {
boolean isPresent = driver.findElements(element).size() > 0;
if (isPresent) {
Object elmtObj = driver.findElements(element).get(0);

if (elmtObj != null && ((MobileElement) elmtObj).isDisplayed()) {
return true;
}
if (isPresent && driver.findElement(element).isDisplayed()) {
return true;
} else {
scroll(driver, pressX, bottomY, pressX, topY);
}
i++;

} while (i <= numberOfScrollDown);

return false;
Expand Down

0 comments on commit bc69fea

Please sign in to comment.