2017-08-10 201 views
0

我收到上述錯誤而執行此代碼org.openqa.selenium.WebDriverException:方法尚未實現 - 使用觸摸動作

WebElement無線電=(WebElement)driver.findElements(By.tagName(」選項「))得到(1)。 radio.click();

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

org.openqa.selenium.WebDriverException:方法尚未實施(警告:服務器未提供任何信息棧跟蹤) 命令持續時間或超時:52毫秒

回答

0

同樣在這裏。

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

這是我使用的代碼。

以爲蒙上了 WebdriverAppiumDriver

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; 
} 

我使用硒3.5.3和5.0.3 Appium

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(); 

我的設備的方法。到目前爲止我發現的是關於錯誤的Appium版本,我無法擺脫這個問題。

相關問題