【问题标题】:org.openqa.selenium.WebDriverException: Method has not yet been implemented - on using Touch Actionorg.openqa.selenium.WebDriverException:方法尚未实现 - 关于使用触摸动作
【发布时间】:2018-01-19 04:57:42
【问题描述】:

执行此代码时出现上述错误

WebElement radio = (WebElement) driver.findElements(By.tagName("option")).get(1);
radio.click();

TouchAction touch = new TouchAction(driver);
driver.performTouchAction(touch).tap(radio);

org.openqa.selenium.WebDriverException:方法尚未实现(警告:服务器未提供任何堆栈跟踪信息) 命令持续时间或超时:52 毫秒

【问题讨论】:

    标签: java appium


    【解决方案1】:

    这里也一样。

    org.openqa.selenium.WebDriverException: Method has not yet been implemented (WARNING: The server did not provide any stacktrace information)
    

    这是我使用的代码。

    TouchAction finger = device.touchAction()
                .press(width / 4, height / 4)
                .waitAction(Duration.ofMillis(10000))
                .moveTo(width / 4, 60)
                .release();
        TouchAction thumb = device.touchAction()
                .press(width / 4, (height / 4) + 40)
                .waitAction(Duration.ofMillis(10000))
                .moveTo(width / 4, 80)
                .release();
        device.multiTouchAction().add(finger).add(thumb).perform();
    

    我将Webdriver 转换为AppiumDriver 的设备方法

    public TouchAction touchAction() {
        if (driver instanceof AppiumDriver) {
            return new TouchAction((AppiumDriver) driver);
        } else {
            try {
                throw new DriverIsNotAnInstanceOfAtriumDriverException(
                        "The driver is not an instance of io.appium.java_client.AppiumDriver");
            } catch (DriverIsNotAnInstanceOfAtriumDriverException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
    

    我正在使用 Selenium 3.5.3 和 Appium 5.0.3。到目前为止,我发现的是错误的 Appium 版本,我无法摆脱这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-06
      • 2017-02-25
      • 2018-08-13
      • 2014-10-25
      • 1970-01-01
      • 2010-11-12
      • 1970-01-01
      相关资源
      最近更新 更多