Search code examples
javaiosmacosappium

Appium is not launching the right application


I'm starting learning automated testing using Appium tools (basing on a java code with eclipse IDE under macOS system)

I think I've Done all the required configuration that I found in a tutorial

but when I'm executing the programme,appium is installing the app that I'm supposed to test but it's launching the integration.app that exists in the WebDriverAgent Xcode project and I don't understand why

actually it installs WebDriverAgent in the phone and that the app that I need to test and the integration app (the default app in the WebDriverAgent project) and it launch the integration.app in my device

here's small code

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("deviceName", "iPhone de Administrateur");
    capabilities.setCapability("platformVersion", "12.2");
    capabilities.setCapability("app","path/app.ipa");
    capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
    capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest");
    capabilities.setCapability("useNewWDA", false);

   capabilities.setCapability("xcodeOrgId", "Haithem Kefi");
   capabilities.setCapability("xcodeSigningId", "iPhone Developer");
   capabilities.setCapability("bundleId",`"bundle");
   capabilities.setCapability("udid", "did");


   IOSDriver driver = new IOSDriver(url, capabilities);
   driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 

   driver.launchApp();

Solution

  • Firstly:

    IOSDriver driver = new IOSDriver(url, capabilities); 
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    

    is enough to launch your application, no need to call driver.launchApp();

    Secondly: try use capabilities.setCapability("fullReset", true); instead of capabilities.setCapability(MobileCapabilityType.NO_RESET, true);