testing - 无法让 I.swipeLeft() 或 I.swipeRight() 使用 Appium 在 CodeceptJS 中工作
问题描述
我正在测试一个原生 Android 应用程序,并希望能够在元素上向左滑动或向右滑动。我在这里阅读了文档:
https://codecept.io/helpers/Appium.html#swiperight
let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipeRight(locator); // simple swipe
I.swipeRight(locator, 500); // set speed
I.swipeRight(locator, 1200, 1000); // set offset and speed
我无法让它工作。我很确定我有正确的定位器,因为当我执行 时I.tap(locator)
,它可以工作。
有没有人设法得到I.swipeRight(locator)
或I.swipeLeft(localtor)
工作?
解决方案
我遇到了同样的问题。我在 iOS 而不是 Android 上这样做,但最终对我有用的是
I.executeScript('mobile: swipe', {direction: 'left'})
对于其他选项(可能是特定于平台的),您可能需要查看 Appium 文档(不特定于 CodeceptJS)。
推荐阅读
- android - AppWidget 中的旋转文本
- swift - 如何快速编写 10 项的 Bessel 函数代码?
- python - 将元素动态添加到多维python列表
- python - 如何使用 pandas.read_csv( ) 读取原来的行名?
- javascript - 从javascript中的函数结果中提取元素
- docker - 超线程会降低 Docker 的性能吗?
- python-3.x - 如何使用 python 和 powershell 将用户添加到 Windows 10
- javascript - 将 id 添加到孩子并将它们存储为数组以列出
- c# - For循环在模型视图ASP.NET MVC C#
- javascript - 如何将 v-bind 的值更新为 prop?