ERROR运行Appium命令:string不是函数

时间:2017-08-25 07:31:53

标签: java scroll appium

我尝试使用Java滚动Android移动应用程序并尝试使用这些代码;

  JavascriptExecutor js = (JavascriptExecutor) driver;
    HashMap<String, String> scrollObject = new HashMap<String, String>();
    scrollObject.put("direction", "down");
    js.executeScript("mobile: scroll", scrollObject);

Eclipse提出了这个错误:

  

线程中的异常&#34; main&#34; org.openqa.selenium.WebDriverException:   ERROR运行Appium命令:string不是函数Command   持续时间或超时:7毫秒

And Appium (version 1.4.16.1) Logs are ;

我也使用WebDriver。 我该如何解决这个错误?

1 个答案:

答案 0 :(得分:1)

语法:driver.swipe(startX,startY,endX,endY,duration);

示例:

driver.swipe(200, 900, 200, 100, 2000);