how to write test script(java) to scroll to a particular cell and perform a click on that cell using appium 1.6.4?

230 Views Asked by At

I have a tableview with a number of tableview cells. Within each cell there are 2 buttons.

What I need is I need to write a test script (in java) to scroll to a particular cell and perform click action in a button which is within the cell.

I am using appium (version 1.6.4), so the scrollto method is deprecated.

Can anyone please help me with this?

1

There are 1 best solutions below

0
MrBlack On

If some elements have accessibility-id you can scroll to these elements by:

WebElement element = this.findElementByIosNsPredicate("name matches '"+ elementName + "'");
new TouchAction(driver).press(element, 0, 0).moveTo(element, 0, 0).release().perform();

elementName - accessibility id

And after it tap on elements in view.