我想滑动以查找/定位IOS应用程序中当前存在的元素 [英] I want to swipe to find/locate an element that is present down in an IOS App

查看:102
本文介绍了我想滑动以查找/定位IOS应用程序中当前存在的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Ios应用,正在对其进行UI自动化.我有一个向下滚动页面的元素/按钮.我已经看到,appium已经贬低了大多数功能,例如滚动,移动和滑动.因为所有帮助都与此有关.我正在使用Appium版本1.13.0(1.13.0.20190505.5)

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)

推荐答案

使用该方法代替appium方法:

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);

如果要向上滑动,请将direction向上更改

change direction to up if you want to swipe up

这篇关于我想滑动以查找/定位IOS应用程序中当前存在的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆