Appium can't scroll on iOS 8.4

I am trying to scroll successfully on Appium using the following code:

// java JavascriptExecutor js = (JavascriptExecutor) driver; HashMap<String, String> scrollObject = new HashMap<String, String>(); scrollObject.put("direction", "down"); scrollObject.put("element", ((RemoteWebElement) element).getId()); js.executeScript("mobile: scroll", scrollObject); 

However, I get a javascript error when trying to scroll outside the bottom of the UITableView due to a known issue in appium: https://github.com/appium/appium/issues/4836

This problem, along with the fact that the appium isDisplayed () method always returns true (regardless of whether a cell is visible on the screen) and appium cannot click on an invisible cell, means that appium cannot scroll and select objects.

Has anyone found a way around this?

+5
source share
2 answers

So, at the moment it seems that this cannot be. Darshan mentioned above, this scrollable question still exists in iOS 8.4 and when surfing the internet it seems that others have the same look

+1
source

Use flick as a possible workaround. We can click on the screen and scroll the screen, as well as elements. We cannot draw a UIAScrollView, but we can use a UIACollectionView.

 JavascriptExecutor js = (JavascriptExecutor) driver; HashMap scrollObject = new HashMap(); scrollObject.put("direction", "down"); js.executeScript("mobile: scroll", scrollObject); 

To solve the problem with isDisplayed () is always true, you can try

  if(!driver.findElements(By.name(using)).isEmpty()) { ... } 

Replace β€œuse” with your locator, I also think that this scroll problem should be solved by Appium mobile: it scrolls and your code looks great, you can also try using vertical swipe instead of scrolling.

0
source

All Articles