【问题标题】:swiping tile is not working on animation images滑动磁贴不适用于动画图像
【发布时间】:2019-01-18 05:41:46
【问题描述】:

滑动磁贴适用于除天气屏幕等动画图像之外的所有其他磁贴/图像。这是我用于滑动普通磁贴/图像的工作代码。

public static void swipeTile(AppiumDriver driver, MobileElement element) {
    try {
           element.isDisplayed();

           int startX = Math.toIntExact(Math.round(element.getSize().getWidth())); 
           int endX = Math.toIntExact(Math.round(element.getSize().getWidth() / 2));
           int startY = element.getLocation().getY();

           TouchAction action = new TouchAction(driver);
           action.longPress(startX,startY).waitAction(500).moveTo(endX, startY).release().perform(); 
          driver.performTouchAction(action); 

    }  
    catch (Exception e) {
        e.getMessage();
    }
}

【问题讨论】:

  • 您是想滚动到页面还是请与我们分享您到底想做什么
  • 我想向左滑动平铺图像。如果我在容器中向左滑动第一个图像,则一次出现一个容器,下一个图像将出现。这两个图像也有不同的 id。 id 类似于 weather_details_today_container_0 和 weather_details_today_container_1
  • 你会分享图片链接还是分享截图

标签: java selenium appium


【解决方案1】:

因此,如果您已经看到他们已经是轮播按钮(用于从一个图像移动到另一个图像的小圆形按钮),如果您单击它,那么您可以轻松地从一个图像跳转到另一个图像,那么如果您想使用您的代码来做自动化然后你可以分享链接,这样你就可以看到并让我们知道它是否有效

http://www.qaautomated.com/2016/02/how-to-move-seekbar-with-appium.html

【讨论】:

  • 感谢 akshay 的链接。它的工作?我使它 int end = element.getSize().getWidth() / 2;否则坐标超出元素
  • 有一个问题。它在我与你共享图像(动画)的磁贴上向左滑动。但另一页中的普通磁贴试图反向滑动。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-08
  • 1970-01-01
  • 2016-12-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多