【问题标题】:How to automate Long Press action in an iOS app using app?如何使用应用程序在 iOS 应用程序中自动执行长按操作?
【发布时间】:2021-03-07 02:59:30
【问题描述】:

我正在尝试在原生 ios 应用上自动执行长按操作。 我的appium版本是1.19。 我已经尝试了以下在 Appium 网站上共享的代码。

    TouchActions action = new TouchActions(driver);
    action.longPress(element);
    action.perform();

请分享运行的代码。

【问题讨论】:

    标签: java selenium appium


    【解决方案1】:

    我遇到了同样的问题。发现它也需要一个释放动作。

    action.longPress(element);
    action.release();
    action.perform();
    

    【讨论】:

      【解决方案2】:
      IOSElement iosElement = (IOSElement) driver.findElement(element);
      TouchAction action = new TouchAction(driver);
      PointOption pointOption = PointOption.point(iosElement.getLocation());
      action.longPress(pointOption).perform();
      

      你可以这样做。

      【讨论】:

        猜你喜欢
        • 2012-08-29
        • 2023-02-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-02-16
        • 1970-01-01
        • 1970-01-01
        • 2015-06-21
        相关资源
        最近更新 更多