【问题标题】:Cannot get I.swipeLeft() or I.swipeRight() working in CodeceptJS with Appium无法让 I.swipeLeft() 或 I.swipeRight() 使用 Appium 在 CodeceptJS 中工作
【发布时间】:2020-08-23 20:23:00
【问题描述】:

我正在测试一个原生 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) 工作?

【问题讨论】:

    标签: testing appium codeceptjs


    【解决方案1】:

    我遇到了同样的问题。我在 iOS 而不是 Android 上这样做,但最终对我有用的是

    I.executeScript('mobile: swipe', {direction: 'left'})
    

    对于其他选项(可能是特定于平台的),您可能需要查看 Appium 文档(不特定于 CodeceptJS)。

    【讨论】:

      猜你喜欢
      • 2021-10-19
      • 2015-08-28
      • 2014-11-08
      • 2017-07-22
      • 2016-10-03
      • 2019-03-07
      • 2012-07-26
      • 2018-08-08
      • 1970-01-01
      相关资源
      最近更新 更多