appium ios,无法在我的ios屏幕上滚动两个分区

时间:2015-02-02 21:02:58

标签: ios appium

无法使用appium在我的ios应用程序屏幕上滑动。

我正在使用appium 1.3.1和iso 8 iphone 6模拟器。

我的ios屏幕分为两个屏幕,顶部有图像,下面有数据......

在设备上我们可以在任何地方滑动,但不能使用appium

我尝试使用iOS SDK 8.1(Xcode 6.1)运行Appium 1.3.1

2 个答案:

答案 0 :(得分:1)

完美的解决方案:

WebElement webElement = wd.findElementByXPath(objectPath);
    try {
        //WebElement element = driver.findElement(By.xpath("//window[1]/tableview[2]"));

        JavascriptExecutor js = (JavascriptExecutor) wd;

        HashMap<String, String> scrollObject = new HashMap<String, String>();

        scrollObject.put("direction", "down");


        scrollObject.put("element", ((RemoteWebElement) webElement).getId());

        js.executeScript("mobile: scroll", scrollObject);

答案 1 :(得分:0)

当字符串包含&#34; abc&#34;时滚动 - driver.scrollTo(&#34; abc&#34;); 对于确切的字符串&#34; abc&#34;看来你可以使用 - driver.scrollToExact(&#34; abc&#34;);