iOS application is not launched

Hi,

iOS application is not launched while running the code through eclipse, looks like program is terminating while launching the app.

Here is the code:

Please help me to proceed here.

Thanks for the help!
Ambika

Hi,
In the capabilities of your test I don’t see any indication for the application launch.
You need to have something like:
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, "com.experitest.ExperiBankO");

Thanks for the response, i have added above line, but still no help
@Before
public void setUp() throws MalformedURLException {
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(SeeTestCapabilityType.REPORT_DIRECTORY, reportDirectory);
dc.setCapability(SeeTestCapabilityType.REPORT_FORMAT, reportFormat);
dc.setCapability(SeeTestCapabilityType.TEST_NAME, testName);
dc.setCapability(MobileCapabilityType.UDID, “8136dac31b54f7a65f8af3ac77b2527a33a57adb”);
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, “com.ZirconConnect.Zircon”);
driver = new SeeTestIOSDriver<>(new URL(“http://”+host+":"+port), dc);
}

Are you sure about the bundle id you provided?
The best way to be sure would be to import the IPA file into the Studio application manager.

Yes, it correct. I tired importing the iPA file again, but no help.

Please let me know anything else i need to do, i am unable to proceed here. As i had a difficult in automating tests using appium on Mac i switched to Appium studio. Here too it is same. Any help is highly appreciated.

Can you post your logs please?

Hi,

I did few change to the driver being initialised. Now the app is launching before even clicking on the application.
@Before
public void setUp() throws MalformedURLException {
try{
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(SeeTestCapabilityType.REPORT_DIRECTORY, reportDirectory);
dc.setCapability(SeeTestCapabilityType.REPORT_FORMAT, reportFormat);
dc.setCapability(SeeTestCapabilityType.TEST_NAME, testName);
dc.setCapability(MobileCapabilityType.UDID, “8136dac31b54f7a65f8af3ac77b2527a33a57adb”);
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, “com.ZirconConnect.Zircon”);
driver = new SeeTestIOSDriver<>(new URL(“http://”+host+":"+port), dc);
}catch(Exception e){
e.printStackTrace();
}
}

@Test
public void testFirstiOSTest() throws MalformedURLException {
setUp();

}

I would like to launch the application be clicking the app icon on the device and verify the splash images at the time of loading.

SeeTestIOSElement element = driver.findElement(By.xpath("//*[@text=‘ZirconMobileApp’]"));

  element.click();  ----This particular code is for clicking the app icon on device, but app is launched before it even come to this block.

If you like to click then the you were right at first - You should not add the capability ‘BUNDLE’.
The reason the app closes at the end of you script is that the diver probably did find what you are searching for in the ‘wait’. If you like the application to stay active after the ‘driver.quit()’ you should use the capability - dc.setCapability(SeeTestCapabilityType.DONT_GO_HOME_ON_QUIT,true);

Thanks, Please let me know is there way to set the reports. Reports are not getting generated when i run the tests using eclipse.

Here is what i have set

As class level

private String reportDirectory = “reports”;
private String reportFormat = “xml”;

Initialisation:

dc.setCapability(SeeTestCapabilityType.REPORT_DIRECTORY, reportDirectory);
dc.setCapability(SeeTestCapabilityType.REPORT_FORMAT, reportFormat);

@After
public void tearDown() {
driver.quit();
// String reportDirectory = driver.getReportFolder();
String reportFolder = driver.getReportFolder();
}

@cheluvambika

Hi,
I have used
public void tearDown() {
driver.quit();
// String reportDirectory = driver.getReportFolder();
String reportFolder = driver.getReportFolder();

Still the reports are not generated.

Appium studio is storing the reports at location:C:\Users\cheluvambika\appiumstudio-reports

where as eclipse stores the reports@ :C:\Users\cheluvambika\appiumstudio-reports\reports under which empty folders are generated for each test, but no results. Is there a way to correct this and get the reports

You can print the string ReportFolder and use the path to get the reports. The reports will be named as index.html.

1 Like

Thanks, I am able to generate the report. tear down() was not called , hence the report was not generated.

1 Like