简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM