Page 1 of 1

RunMobileApp and CloseApplication not working on iOS 9

Posted: Fri Oct 23, 2015 5:47 pm
by tvu
Hello,

The methods Host.Local.RunMobileApp() and Host.Local.CloseApplication() are not working as expected in iOS 9.0. They work fine in iOS 8.4.

Run Mobile App:
I tried to start my app with the Ranorex Service App in the foreground, but I get a "Failed to start app" timeout error. I've increased both my connection timeout and remote call timeout to 1 minute as describe in these threads: http://www.ranorex.com/forum/failed-to- ... t6204.html and http://www.ranorex.com/forum/device-com ... t6197.html. I've tried using the "Run Mobile App" action and calling the code directly with Host.Local.RunMobileApp(deviceDisplayName, appName, true). When Restart App = true, the app would launch once, but doesn't go back to the Service App to relaunch a second time. It just stays in my app and gets the connection timeout error. I don't get a timeout error if set Restart App = false. But, this isn't my desired action since I want to start my application in its initial state.

Close Application:
My app gets removed from the foreground when I call the Host.Local.CloseApplication(), but it doesn't return to the Ranorex Service App. It goes back to the iPhone home screen. At this point, I can't relaunch my app since the Ranorex Service App is not in the foreground.

Also, shouldn't the CloseApplication() method actual kill the app process instead of just bringing to the background? Is there a way to actually close the application?

Thanks.

Setup:
iPhone 5, iOS 9.0.2
iPhone 6, iOS 8.4
Ranorex 5.4.2.25689
Note: I've tried installing the Ranorex Service app using the Instrumentation Wizard and directly from the mobile download page.

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Tue Oct 27, 2015 7:04 pm
by tvu
Is anyone else experiencing this issue?

I am just guessing here, but I think this issue might be related to iOS 9 URL Scheme changes. There is no way for me to verify this because I don't have the RxService App Xcode project to debug with.

http://awkwardhare.com/post/12119600673 ... me-changes

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Fri Oct 30, 2015 2:21 pm
by Support Team
Hello tvu,

We are not aware of any similar issue at the moment.

Unfortunately, we had some issues with instrumenting your app.
It seems like the IPA-file is corrupted.
It would be great if you could try uploading it again to our FTP-server.

I will try reproducing the issues with your app as soon as I'm able to instrument it.

As you mentioned the CloseApplication()-method just brings the application to the background.
I'm afraid that there is no way of closing a mobile application completely.

Thank you in advance.

Regards,
Johannes

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Fri Oct 30, 2015 5:07 pm
by tvu
Hi Johannes,

I uploaded our latest build.

Thanks.

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Mon Nov 02, 2015 11:57 am
by Oksana
Hi,

It seems that I've faced the same problem with Host.Local.RunMobileApp(deviceDisplayName, appName, true).
I can add, that while calling this method, appropriate adb log contains such debug info:

2015/11/02 12:10:12:660 Debug: AppStatusEvents set to '1'
2015/11/02 12:10:14:362 Debug: BGT is alive (420 s)
2015/11/02 12:10:17:035 Debug: App Stauts events disabled. Will not be sent to Ranorex.
2015/11/02 12:10:22:664 Debug: AppStatusEvents set to '0'

Regards,
Oksana

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Wed Nov 04, 2015 10:36 am
by Support Team
Hello,

We were able to reproduce the issue with an iOS9 app.

Unfortunately, there is an issue with starting/closing the app when it is compiled for iOS9.
I'm afraid that the only workaround would be to compile the app for iOS 8 SDK.

We are currently working on a solution and I will update you as soon as I have new information.

Thank you for your understanding.

Regards,
Johannes

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Thu Nov 19, 2015 2:06 pm
by Support Team
Hello,

The bug was fixed in the latest version of Ranorex, 5.4.4.

More information about Ranorex 5.4.4 can be found in the release notes.

Regards,
Johannes

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Thu Nov 19, 2015 4:32 pm
by Oksana
Thanks.

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Tue Sep 06, 2016 5:38 pm
by alb
Hi,
I have a similar issue.
I'm using Ranorex 5.4.6 and Ranorex Service App 2.1.1.
I'm testing an iOS app on an iphone SE with iOS version 9.3.2.

The RunMobileApp and CloseApplication actions normally work correctly.

If I execute a specific action on our app (click on a button) and then I execute the RunMobileApp
and/or CloseApplication actions again, I get the following errors respectively:

- Failed to start app 'com.@@@@@@@.@@@@@@@@@@@@@' because the app started event was not received within the specified timeout of '00:00:10 (+00:00:16)'.
- Failed to find item '.....'.
No element found for path '.....' within 6000ms.

If I close our app and the Ranorex Service App and I open again the ranorex Service App, the RunMobileApp and CloseApplication actions return to work properly.

I attach the logs of the Ranorex Service App, taken with log level Debug, in which I have put some subtitution characters (@) in place of our app name.
Log of RunMobileApp and CloseApplication actions executed successfully: log_start_close_app_ok.txt
Log of RunMobileApp and CloseApplication actions executed with failures: log_start_close_app_ko.txt

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Thu Sep 08, 2016 8:33 am
by Support Team
Hi alb,

May I ask you if you have already tried increasing the connection timeout in the Ranorex settings dialog?
Connection_timeout.png
Please try a higher value (for example 30 seconds) and let me know if the problem still occurs.

Thank you.
Regards,
Markus (S)

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Fri Sep 09, 2016 1:31 pm
by alb
Yes, I have tried with a Connect timeout of 30s and 2m, but I get the same result.

After the problem appears I clicked on the Retry button (in the Devices window) and both the phone and the app seem to be recognized correctly.
Then I clicked on the edit button next to an item, in the ranorex repository, used during the tests:
the Ranorex Spy opened, but in the top right corner of the screen a window appeared with the following error message:

Technology: iOS

Service app is not installed or running on the device.
Automation capabilities will be limited. For example
starting and stopping apps will not be possible. To enable
all functionality make sure the service app is installed and
was started.

On the iphone there are two applications running: the Ranorex Service App and our app, so the Ranorex Service App was started.

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Tue Sep 13, 2016 9:38 am
by Support Team
Hi alb,

Thank you for your response.

I'm afraid I'd need to analyze this behavior directly with your application. Therefore, I'd like to ask you if you can send me a non-instrumented copy of your application under test to [email protected]?

Thank you in advance.
Regards,
Markus (S)

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Fri Sep 16, 2016 2:56 am
by FelixK98
Hi Marcus,

I got issue with CloseApplication() function. It just removes the App from foreground and not close it completely.

I got:
Service version: 2.2.0
iOS Version: 9.3.5
Ranorex version: 6.1.0

Thanks,
Felix.

Re: RunMobileApp and CloseApplication not working on iOS 9

Posted: Fri Sep 23, 2016 9:16 am
by Support Team
Hi Felix,

The observed behavior is expected since it is not possible to close the application due to apple’s security restrictions. Anyway, if you need to restart your application we have implemented a functionality in our Ranorex Service application which allows you to reset the application to its initial state.
To do so, please set the “Restart App” parameter to “True”

Sincerely,
Markus (S)