I want to swipe to find/locate an element that is present down in an IOS App

丶灬走出姿态 提交于 2019-12-11 15:28:25

问题


I have an Ios app and I'm doing UI automation of it. I have an element/button that is one scroll down the page. I have seen that appium has depreciated most of the functions like scroll, moveto and swipe. since all of the help is related to that. I am using Appium Version 1.13.0 (1.13.0.20190505.5)


回答1:


Use that method instead of appium methods:

JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<>();
scrollObject.put("direction", "down");
js.executeScript("mobile: swipe", scrollObject);

change direction to up if you want to swipe up



来源:https://stackoverflow.com/questions/58004430/i-want-to-swipe-to-find-locate-an-element-that-is-present-down-in-an-ios-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!