【发布时间】:2018-02-03 05:01:18
【问题描述】:
我正在尝试使用 Java 在 Android 移动应用程序上滚动并尝试这些代码;
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("direction", "down");
js.executeScript("mobile: scroll", scrollObject);
Eclipse 出现此错误:
线程“主”org.openqa.selenium.WebDriverException 中的异常: 运行 Appium 命令时出错:字符串不是函数命令 持续时间或超时:7 毫秒
And Appium (version 1.4.16.1) Logs are ;
我也在使用 WebDriver。 我该如何解决这个错误?
【问题讨论】:
-
executeScript 需要一个脚本来执行,你给它一个字符串 hashmap。我相信这可能是你的错误:seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/…
-
@Kathara 谢谢,可能是这样,但这些代码是由 appium 从那里提供的:appium.io/slate/en/master/?java#touchaction 你有什么办法可以解决这个问题吗?
-
你能告诉我哪一行是android-controller.js中的第690行吗?
-
689 androidController.scroll = function (direction, cb) { 690 cb(new NotYetImplementedError(), null); 691 };
-
根据您的日志,这是您的问题发生的地方...