Android App close issue with Host.Local.CloseApplication

Mobile Testing, Android App Testing.
htrudel
Posts: 8
Joined: Tue Oct 29, 2013 8:40 am
Contact:

Android App close issue with Host.Local.CloseApplication

Post by htrudel » Tue Feb 11, 2014 6:51 pm

Hi,

We have an issue closing our application using the Host.Local.CloseApplication function.
While testing regular windows application it works as expected and closes the application.
But on Android, it seems to only close the UI.

When we then execute Host.Local.RunMobileApp, the application seems to resume instead of restarting.

We have a "dirty" workaround for using adb shell am force-stop <app_name> but we would prefer using Ranorex function.

Is that a bug in the Ranorex Android Automation Service?
Is there any other way to do this?

Thank you.
Hugo Trudel
Software Engineer
Distech Controls Inc

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Android App close issue with Host.Local.CloseApplication

Post by krstcs » Tue Feb 11, 2014 7:13 pm

Have you tried the Ranorex.Host.KillApplication(Element) function?

http://www.ranorex.com/Documentation/Ra ... cation.htm


CloseApplication will be limited to only being able to do what the app does on close. Some apps just minimize the display, some kill the process. Close doesn't do anything but tell the app to use its own close mechanism.

Kill (if it works in Android, I'm not sure), should actually end the process. But, again, it may not work on Android.
Shortcuts usually aren't...

htrudel
Posts: 8
Joined: Tue Oct 29, 2013 8:40 am
Contact:

Re: Android App close issue with Host.Local.CloseApplication

Post by htrudel » Tue Feb 11, 2014 9:42 pm

I just tried it and the behavior is the same as for Host.Local.CloseApplication.

I have asked our Android app developers and their explanation is that Ranorex Automation Service sends a flag activity "Clear Top", which is equivalent as clicking Android Device Home button to pause an App.

My question is this:

Is this the desired behavior for the Ranorex Automation Service Host.Local.CloseApplication and Host.Local.KillApplication?

Thanks.
Hugo Trudel
Software Engineer
Distech Controls Inc

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

Re: Android App close issue with Host.Local.CloseApplication

Post by Support Team » Thu Feb 13, 2014 2:27 pm

Hi,

You are right it is currently, with Ranorex 4.1.5, not possible to completely close the app.
This feature should be available with Ranorex 5.0.

Regards,
Markus

htrudel
Posts: 8
Joined: Tue Oct 29, 2013 8:40 am
Contact:

Re: Android App close issue with Host.Local.CloseApplication

Post by htrudel » Wed Jul 02, 2014 7:54 pm

I have now had the chance to try it with Ranorex version 5.0.2 and it seem to work on Android.
However, it does not work on iOS...
Getting there someday! :wink:
Hugo Trudel
Software Engineer
Distech Controls Inc

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Android App close issue with Host.Local.CloseApplication

Post by krstcs » Thu Jul 03, 2014 1:52 pm

htrudel, 5.1 was just release, you might try it to see if it works better for iOS.
Shortcuts usually aren't...