Reputation: 7019
We are using Appium 1.5.3.
When Appium launches our app to test it, parts of the app are not scrolled into view. Appium is unable to interact with those parts at all.
Say we want to click on a button that is not currently in the visible portion, the only way to click it is to repeatedly scroll and attempt to click. That's not a proper solution for all cases, I'm just giving it to describe the problem.
I'm wondering if we're doing something wrong, or if this is a known Appium limitation and how to work around it?
Upvotes: 4
Views: 1143
Reputation: 1023
Its not a limitation with Appium, but its with the Android Framework. If you use UIAutomator and scan your mobile screen, you will find that UIAutomator only shows the elements that are currently displayed on the screen. It doesn't show those elements which are not visible (the ones where you would need to scroll up/down).
But if you try the same in iOS, you would notice that iOS exposes all the elements on the screen - the elements currently visible and the ones that need to be scrolled. So there is no need to scroll in iOS
There's no workaround for this. The only option is to scroll up/down and bring the element which you want to work on, on the visible screen.
Appium provides many options which help you scroll on the screen -
driver.swipe(startX, startY, endX, endY, duration);
TouchAction
TouchAction touchAction = new TouchAction(driverMobile);
touchAction.press(startX, startY).moveTo(endX, endY).release().perform();
With TouchActions, you can either scroll using coordinates or by elements on the screen as well.
Upvotes: 1