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

查看:25
本文介绍了我想滑动以查找/定位存在于 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天全站免登陆