我是Appium的新手。我嘗試使用Appium在移動設備上執行我的硒腳本。但我得到了像下面Appium,WebDriver
org.openqa.selenium.WebDriverException的錯誤:返回值不能 轉換爲
WebElement: {ELEMENT=0.5768692365381867-1}
我使用的代碼是如下: -
AppiumDriver d;
@BeforeClass
public void setUp() throws Exception
{
//Set Capabilities
DesiredCapabilities caps=new DesiredCapabilities();
caps.setCapability("deviceName", "Celkon A35K Remote");
caps.setCapability("platformName", "Android");
caps.setCapability("platformVersion", "4.4.2");
caps.setCapability("browserName", "Browser");
d = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), caps);
d.manage().timeouts().implicitlyWait(60,TimeUnit.SECONDS);
d.manage().timeouts().pageLoadTimeout(120,TimeUnit.SECONDS);
}
@Test
public void testFBLogin() throws Exception
{
//Load web page
d.get("https://www.facebook.com/");
//Enter user name
d.findElementByName("email").sendKeys("Appium");
//Enter password
d.findElementByName("pass").sendKeys("Appium");
//Click on Login
d.findElementByName("login").click();
Thread.sleep(10000);
}
@AfterClass
public void tearDown()
{
//Close browser
d.quit();
}`script:
在哪一行,你得到這個錯誤? –