java - 滑动磁贴不适用于动画图像
问题描述
滑动瓷砖适用于所有其他瓷砖/图像,除了像天气屏幕这样的动画图像。这是我用于滑动普通瓷砖/图像的工作代码。
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();
}
}
解决方案
因此,如果您已经看到他们已经是 Carousel 按钮(用于从一个图像移动到另一个图像的小圆形按钮),如果您单击它,那么您可以轻松地从一个图像跳到另一个图像,那么如果您想使用您的代码进行自动化,那么你可以分享链接,这样你就可以看到并让我们知道它是否有效
http://www.qaautomated.com/2016/02/how-to-move-seekbar-with-appium.html
推荐阅读
- nuget - TeamCity 克隆的构建配置因 NuGet 错误而失败
- javascript - master-atul/react-native-exception-handler - 不捕获 node_modules 中的错误
- microsoft-graph-api - Microsoft Teams:使用 Graph API 跟踪/列出通话中的参与者
- javascript - ClickEvent(或查询选择器)无法正常工作
- reactjs - 如何使用graphQL父参数
- ios - iOS 谷歌分析日落
- c - 错误:一元'*'的无效类型参数(有'long int')
- c# - 通过“JoinDomainOrWorkgroup”加入域时使用新的 PC 名称
- javascript - 将多级 JSON 简化为一组唯一记录
- ansible - 如何从ansible中的find模块获取匹配的返回值?