Hi,
I am on Mac and working with real device.
I am using Appium 1.15.1, Selenium, Java with POM.
I wrote following code for iOS swipe down.
Hi,
public void chkMenuOptioniOS1(String sName)
{
/* This is actual path which got from inspector
//XCUIElementTypeStaticText[@name=“Account Information”]
*/
String targetCell = “//XCUIElementTypeStaticText[contains(@name,’” + sName + “’)]”;
MobileElement cellWithText = driver.findElement(By.xpath(targetCell));
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put(“element”, ((RemoteWebElement)cellWithText).getId());
scrollObject.put(“direction”, “down”);
scrollObject.put(“predicateString”, “value == '” + sName + “’”);
scrollObject.put(“toVisible”, “true”);
driver.executeScript(“mobile:scroll”, scrollObject);
try {
System.out.println("In Try Block "+cellWithText.getText());
Thread.sleep(10);
cellWithText.click();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
- It scrolling twice
- and it;s not clicking,
Attaching DOM object screen capture.
Please help me