6

I want to scroll down to a specific element in my iPad application. I was using 'mobile:scroll', but it is not working now. Can someone help with a working code?

2 Answers2

0

You can use swipe function to scroll down by particular dimensions and then verify for the presence of the element.If the element present perform the necessary steps else scroll down and check again.Refer below link for swipe functionality.

http://www.software-testing-tutorials-automation.com/2015/11/appium-how-to-swipe-vertical-and.html

SaiPawan
  • 1,189
  • 7
  • 20
  • The link you posted is using the swipe method, which was deprecated in version 1.6.4 of Appium. Do you have a new link to help me with this problem. I read about the TouchAction but I can't get it to work for me when the keyboard is visible. – Buzz May 24 '17 at 09:05
  • which java client version you are using.It is deprecated in latest beta versions of java client.Use the stable java client 4 – SaiPawan May 24 '17 at 09:20
  • Will it get deprecated in the stable version of java-client 5.0? Because if that's the case, I need to find a solution for scrolling down to the element. – Buzz May 24 '17 at 09:55
  • yes we hav to investigate for other alternative in 5.0.They will include some alternative for that right ? – SaiPawan May 24 '17 at 11:00
0

Use Touch action:

Point requiredPosition = new Point(x,y);
Point currentPOsition = element.getLocation();
TouchAction touchAction = new TouchAction(driver);
touchAction.press(startx,requiredPosition.getY()).waitAction(Duration.ofSeconds(2)).moveTo(startx, currentPOsition.getY()).release().perform();

loop these steps such that after moveTo, element should be present on screen

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103