2016-06-09 48 views
0

stacktrace screenshot我想通過Appium運行我寫的不同測試Android設備,但我收到以下錯誤:Appium-JAVA錯誤:無法從bundle'731'加載類'org.eclipse.ui.internal.ide.application.addons.ModelCleanupAddon'

unable to load class 'org.eclipse.ui.internal.ide.application.addons.ModelCleanupAddon' from bundle '731'

unable to load class 'org.eclipse.ui.internal.ide.application.addons.ModelCleanupAddon' from bundle '561'

我的代碼是:

import org.openqa.selenium.By; 
//import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.WebElement; 
//import org.openqa.selenium.WebElement; 
//import org.openqa.selenium.remote.DesiredCapabilities; 
//import org.openqa.selenium.remote.RemoteWebDriver; 
import io.appium.java_client.AppiumDriver; 
import io.appium.java_client.android.AndroidDriver; 
//import org.testng.annotations.AfterClass; 
import org.testng.annotations.BeforeClass; 
import org.testng.annotations.Test; 
import org.testng.annotations.AfterTest; 


import java.io.File; 
import java.net.URL; 
import java.net.MalformedURLException; 
//import java.util.concurrent.TimeUnit; 
//import org.junit.Test; 


public class CustomerLogin { 
     AppiumDriver driver; 
     takeScreenshot SC; 
     @BeforeClass 
      public void setUp() throws MalformedURLException{ 
      File app = new File(System.getProperty("user.dir")+ "\\apks\\DropCarOwner-STAGE-v2.1.0-rc.1.apk"); 
    DesiredCapabilities capabilities = new DesiredCapabilities(); 

    capabilities.setCapability("DeviceName","306SH"); 
    capabilities.setCapability("PlatformValue", "4.4.2"); 
    capabilities.setCapability("PlatformName", "Android"); 
    capabilities.setCapability("app",app.getAbsolutePath()); 

    driver= new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities); 
}*/ 
@Test 
public void Login() throws Exception{ 
    WebElement email= driver.findElement(By.id("com.dropcar.owner:id/editTextEmailAddress"));//com.dropcar.owner:id/editTextEmailAddress 
    email.sendKeys("a","w","a","i","s","d","u","r","r","a","n","i","8","7","@","g","m","a","i","l",".","c","o","m"); 

    WebElement password= driver.findElement(By.id("com.dropcar.owner:id/editTextPassword")); //com.dropcar.owner:id/editTextPassword 
    password.sendKeys("c","h","e","c","k","i","n","g","1","2","3"); 

    WebElement check= driver.findElement(By.name("Remember me")); //com.dropcar.owner:id/checkBoxRememberMe 
    driver.tap(0, check,0); 
    //check.click(); 

    WebElement signIn=driver.findElement(By.name("SIGN IN")); 
    driver.tap(1,signIn,1); 
    //signIn.click(); 

    SC.Screenshot(driver); 


} 

@AfterTest 
public void end(){ 
    driver.quit(); 
} 


} 

我正在使用Eclipse 4.4.1。我該如何解決這個錯誤?

回答

0

在運行腳本之前確保appium-doctor命令運行成功。如果您將附上appium日誌,那麼將更容易告訴您問題的實際解決方案。

相關問題