简体   繁体   English

滑动不适用于iOS的Appium

[英]Swipe not working Appium for iOS

I am using Appium version 1.4.0 (draco) and Version 6.4 of Xcode. 我正在使用Appium版本1.4.0(draco)和版本6.4的Xcode。 I cannot get the swipe feature to work on my automated test. 我无法在自动测试中使用滑动功能。 The iOS simulator device is iPad air. iOS模拟器设备为iPad air。 Any helpful post would be greatly appreciated. 任何有用的帖子,将不胜感激。

Is the mobile App page Table View or Scroll View?. 移动应用程序页面是“表视图”还是“滚动视图”? It works in table view but not in Scroll View. 它在表格视图中有效,但在滚动视图中无效。

This is working for me. 这对我有用。 Try this solution and it should work. 试试这个解决方案,它应该可以工作。 I have Appium 1.4.13; 我有Appium 1.4.13; Xcode 7.0.1 with Java-Client 3.2.0 and this is working in iOS 8.x / 9.0 simulators. 带有Java-Client 3.2.0的Xcode 7.0.1,可在iOS 8.x / 9.0模拟器中使用。 "ElementName" is the name of element where screen is scrolled till there. “ ElementName”是屏幕滚动到此处的元素名称。

 JavascriptExecutor js = (JavascriptExecutor) iosDriver; HashMap <String, String> scrollObject = new HashMap <String, String>(); scrollObject.put("element", ((RemoteWebElement) iosDriver.findElement(By.name("elementName"))).getId()); js.executeScript("mobile: scroll", scrollObject); 

what language are you using? 您使用什么语言?

in ruby this is working for me execute_script "mobile: scroll", direction: "right" 在红宝石这对我来说是execute_script "mobile: scroll", direction: "right"

you can check the full list here 您可以在此处查看完整列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM