Appium-Ruby-IOS- One native app calls another native app

Hi Experts,

In my scenario Native app A calls another native app B and i need do some actions and again it goes back to app A.
In android i am able to automate my my scenarios with out any problem but in IOS i am not able to do it is throwing ‘Selenium::Client::CommandError: mainWindow is nil’ error.

Some one told that these kind of scares not possible in IOS. Is it correct?

app A is the app you are automating? If it is, does it calls app B via a button/link present on app A?

If the above are correct then it should be possible to automate normally. Like when one app sends an email and it calls native email, its possible to interact with elements of the native email.

Yes you r right…“I am automating app A and it calls appB via clicking on one link”
I am getting “Selenium::Client::CommandError: mainWindow is nil”

On what command you get that? And its the first query you do on appB?

Have you tried via arc or inspector and find out if elements on appB are visible?

When i try to find the element on App B( which is first action on App B)
Find element code works fine in another scenario where i work on only app B.

And in Arc also i can able to see that

As far as I know you can’t automate multiple applications due to limitations in Instruments set by Apple.

You can try your scenario it may work in iOS Simulator, considering app2 is also installed on simulator.

But on real device you can only automate those app’s which are build using your apple account provisioning profile. If app2 is also build by your developer certificate then I guess it would be possible else not.

Biggest example you can never install an app on iOS real device other then iTunes. Unlike android way where using adb you can install any apk file on mobile.

Thats not exactly true.

For example you cannot see SMS received, if you try to go to message app directly. But if within your app you have an entry that will redirect you to message app, then you can automate it. I use that on my tests, both native messaging and email.

@Telmo_Cardoso

Thanks for correcting my statement. I never tried that, but based on business model this could be possible because while submitting app on apple store they review app code and all redirection from with in app like purchase links or anything other than that are charged on basis of revenue generated by app. So it might be possible apple allows communication b/w app’s.

I just tried opening Setting page by minimizing my current app and it didn’t worked, might be because there is not redirection of settings page from with in app.

Test Case was to found the cache size of app.