我正在尝试使用 Java 滚动 Android 移动应用程序并尝试这些代码;
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("direction", "down");
js.executeScript("mobile: scroll", scrollObject);
Eclipse 给出了这个错误:
Exception in thread "main" org.openqa.selenium.WebDriverException: ERROR running Appium command: string is not a function Command duration or timeout: 7 milliseconds
And Appium (version 1.4.16.1) Logs are ;
我也在使用 WebDriver。 我该如何解决这个错误?
最佳答案
语法:driver.swipe(startX, startY, endX, endY, 持续时间);
示例:
driver.swipe(200, 900, 200, 100, 2000);
关于java - 运行 Appium 命令时出错 : string is not a function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45876406/