Not able to scroll to the last in ios simulator

simultor iphone 5s , platform 9.3 , appium version : 1.5.3

Tried the same with these below mentioned ways :

a)
Dimension dimensions = constant.driver.manage().window().getSize();
Double screenHeightStart = dimensions.getHeight() * 0.5;
int scrollStart = screenHeightStart.intValue();
System.out.println(“scrollStart”+scrollStart);
Double screenHeightEnd = dimensions.getHeight() * 0.2;
int scrollEnd = screenHeightEnd.intValue();
System.out.println(“scrollEnd”+scrollEnd);
for (int i=0;i<4;i++)
{
constant.driver.swipe(0,scrollStart,0,scrollEnd,3000);

		}

b).
JavascriptExecutor js = (JavascriptExecutor) constant.driver;
// HashMap <String, String> scrollObject = new HashMap <String, String>();
// scrollObject.put(“element”, ((RemoteWebElement) constant.driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[8]/UIAStaticText[1]"))).getId());
// js.executeScript(“mobile: scroll”, scrollObject);

Please help :slight_smile:

Use element position and dimensions that need to be scrolled! Dont use whole screen and specially min/max positions like “0”.

How i can find the dimension or co-ordinates in iphone simulator.

Hello, Please help -> Not able to scroll to the last element in iOS simulator.

appium version -> 1.6.5
iOS 10.3

Java code to scroll down in iOS
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();

// Scroll down to a visible text

scrollObject.put(“direction”, “down”);
scrollObject.put(“name”, “visible text”);
js.executeScript(“mobile: scroll”, scrollObject);

//simply scroll down to end

scrollObject.put(“direction”, “down”);
js.executeScript(“mobile: scroll”, scrollObject);

For more details please browse https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md