2

I am trying to login in app. using appium but getting following error :

An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds

My code is :

public class appi {

public static WebDriver driver;

public static void main(String[] args) throws MalformedURLException {
    // TODO Auto-generated method stub



    File classpathRoot = new File(System.getProperty("user.dir"));
    File appDir = new File(classpathRoot, "");
    File app = new File(appDir, "myapp.apk");
    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
    capabilities.setCapability("device", "Android Emulator");
   // capabilities.setSerial("192.168.xx.xxx:5555");
    capabilities.setCapability("platformName", "Android");

    capabilities.setCapability("deviceName","vds");
    capabilities.setCapability("platformVersion", "19");
    capabilities.setCapability("app-package", "air.iNMyBabyPaid"); //Replace with your app's package
    capabilities.setCapability("app-activity", "com.ripl.earlythree.activities.SplashActivty"); //Replace with app's Activity
    capabilities.setCapability("app", app.getAbsolutePath());

    driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub/"), capabilities);

    //driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);



     WebElement username = driver.findElement(By.xpath("(//EditText)[1]"));
      Assert.assertEquals("true", username.getAttribute("enabled"));

     if(username.isDisplayed())
     {

        username.click();

        username.sendKeys("sparent");

     }
     else
     {


         System.out.println("Your element not found");


     }


    driver.close();
   }

  }

When I run program , It just open App. in emulator and then stops.

Any idea?

2

Issue is resolved by correcting "app-package". I was using old app "app-package".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.