How do I detect if my App has crashed?

Ask general questions here.
stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

How do I detect if my App has crashed?

Post by stapes » Wed Sep 30, 2015 10:39 am

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

User avatar
RobinHood42
Posts: 324
Joined: Fri Jan 09, 2015 3:24 pm

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

Post by RobinHood42 » Tue Oct 06, 2015 10:35 am

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" />

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

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

Post by stapes » Tue Nov 03, 2015 12:25 pm

When the application crashes on Android device, I get a dialog:

Unfortunately, myAppName has crashed.

I still need to be able to detect this.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Tue Nov 03, 2015 12:41 pm

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

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

Post by stapes » Tue Nov 03, 2015 4:34 pm

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Wed Nov 04, 2015 8:41 am

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri Nov 06, 2015 11:06 am

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)

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

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

Post by stapes » Mon May 09, 2016 4:24 pm

Hi

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

Steve

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Thu May 12, 2016 10:06 am

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)

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

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

Post by stapes » Tue May 17, 2016 9:54 am

My apologies. I seem to have confused two threads.