Page 1 of 1

How do I detect if my App has crashed?

Posted: Wed Sep 30, 2015 10:39 am
by stapes
Yesterday I managed to break the App I was testing, so today, after the program loads and a button is pressed, it crashes with a dialog: Unfortunately AgileMobileApp has stopped.

I tried detecting if the Login form was still present/visible with a bit of code, but that didn't work. It still exists!!

Code: Select all

if(repo.AgileMobileApp .LoginPage .SelfInfo.Exists())
How do I tell if my form is visible?

Alternatively, how can I tell if my app has crashed?

I tried validating a control from the following form:

Code: Select all

Validate.Exists(repo.AgileMobileApp.LoginPage.AdvancedLoginPage.AddButtonGreenPlusInfo);
But that actually says the control exists when it clearly doesn't!!!

However, the touch command following failed with this most bizarrely worded message:
Injecting to another application requires INJECT_EVENTS permission

Re: How do I detect if my App has crashed?

Posted: Tue Oct 06, 2015 10:35 am
by RobinHood42
Sometimes this message appears if the same app is opened on different devices.
I'm not sure, but if this could also be the problem on your side.
Additionally, if you instrument the app with source code, don't forget to add the following code to the manifest.
<uses-permission android:name="android.permission.INTERNET" />  
<uses-permission android:name="android.permission.INJECT_EVENTS" />

Re: How do I detect if my App has crashed?

Posted: Tue Nov 03, 2015 12:25 pm
by stapes
When the application crashes on Android device, I get a dialog:

Unfortunately, myAppName has crashed.

I still need to be able to detect this.

Re: How do I detect if my App has crashed?

Posted: Tue Nov 03, 2015 12:41 pm
by odklizec
Hi,

Are you able to track this dialog with Ranorex Spy? If so, then add it to repository and then implement unexpected dialog handling, as described here:
http://www.ranorex.com/support/user-gui ... html#c4678

Re: How do I detect if my App has crashed?

Posted: Tue Nov 03, 2015 4:34 pm
by stapes
Ranorex Spy does not seem to see it.

It still has MobileApp 'uk.co.documotice.mobile.documobile.agile' (our app)

If I leave it long enough, the app restarts !


Our app seems to have 2 types of crash (so far):

This one - i.e. with message: AppName needs to close

The other - it may or may not hang for a while - then the device goes blank & restarts itself.

Re: How do I detect if my App has crashed?

Posted: Wed Nov 04, 2015 8:41 am
by odklizec
Hi,

Well, if Spy cannot detect the dialog, it's most probably Android's own dialog and therefore, it cannot be accessed and manipulated by Ranorex. Your only hope is to somehow detect (in loop, another thread, etc...) the app presence via Ranorex API? Unfortunately, I don't know much about testing mobile apps so maybe Ranorex folks can help here?

Re: How do I detect if my App has crashed?

Posted: Fri Nov 06, 2015 11:06 am
by Support Team
Hi stapes,

As odklizec already mentioned, this dialog is provided by the Android OS. A possible way to recognize this dialog would be to enable the Android OS automation as described in our user guide

Please note the following restriction when using this intention
  • To automate system apps a USB connection has to be established.
    Highlighting on the device does not work for system apps
    Recording is not possible for system apps
Regards,
Markus (S)

Re: How do I detect if my App has crashed?

Posted: Mon May 09, 2016 4:24 pm
by stapes
Hi

The app in question is an IOS app. How can I tell if my IOS app has crashed - using Ranorex?

Steve

Re: How do I detect if my App has crashed?

Posted: Thu May 12, 2016 10:06 am
by Support Team
Hi Steve,

I'm afraid I'm a bit confused. In the initial post you have written Android device
stapes wrote:When the application crashes on Android device, I get a dialog:
Unfortunately, myAppName has crashed.
but in your last post, you have mentioned that the app in question is an iOS app.
stapes wrote: The app in question is an IOS app. How can I tell if my IOS app has crashed - using Ranorex?
Steve
Anyway, if there is a dialog shown on your iOS device and this dialog is provided from the application under test it should be possible to track that. If the dialog is provided directly from the OS itself, I'm afraid that you will need to check if the mainform is still visible.

Regards,
Markus (S)

Re: How do I detect if my App has crashed?

Posted: Tue May 17, 2016 9:54 am
by stapes
My apologies. I seem to have confused two threads.