Error "failed to start app" even though app was started

Mobile Testing, Android App Testing.
OfferistaGroup
Posts: 4
Joined: Tue Jul 04, 2017 10:44 am

Error "failed to start app" even though app was started

Post by OfferistaGroup » Wed Sep 20, 2017 9:46 am

Hey,

I'm wondering if anyone experienced a similar behavior.

Currently, I'm not able to automate the app. Executing the "Run Mobile App" action correctly starts the app on the connected device, but displays the following error message:

Code: Select all

Failed to start app 'de.app.android.debug' because the app started event was not received within the specified timeout of '00:00:20'.
Timeout für den Vorgang wurde überschritten. 

bei Ranorex.Plugin.Mobile.Device.MobileDevice.WaitForAppStartedEvent(AppInformation appInfo, TimeSpan timeout, TimeSpan waitTimeCorrection) bei Ranorex.Plugin.Mobile.Device.MobileDevice.StartApplication(AppInformation app, Boolean resetInitialState) bei Ranorex.Host.RunMobileApp(String deviceDisplayName, String appName, Boolean resetInitialState) bei Android_App.RunApp.Ranorex.Core.Testing.ITestModule.Run() in c:\Users\User\Documents\Ranorex\RanorexStudio Projects\App-Testing\Android-App\RunApp.cs:Zeile 83. bei Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Boolean skipIteration)
So I can't automate stuff because Ranorex doesn't seem to find the device.

* The latest versions of Ranorex Studio and Ranorex service are running
* The device is connected via wifi
* The endpoint menu displays "Connected"
* The device information in the endpoint menu shows "Nexus 5 (No app running)" though

MartinKubal
Posts: 10
Joined: Wed Aug 16, 2017 8:16 pm

Re: Error "failed to start app" even though app was started

Post by MartinKubal » Wed Sep 20, 2017 10:39 am

Hi,
sometimes helps uninstall all versions of app under test from device and then deploy it again using Instumentation Wizard. I've sen this problem on slow devices with less RAM. I am testing now on Nexus 6P and Xiaomi RedMi2 (among other devices) and this particullar problem was only on Xiaomi. App starts on device, but because of response timeout Ranorex is still saying that no app started.

Just to be sure, check you recording if there is set Current Endpoint and argument Restart App is True.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error "failed to start app" even though app was started

Post by Support Team » Thu Sep 21, 2017 8:21 pm

Hello OfferistaGroup,

Thank you for posting this topic concerning application start time in the Ranorex forums.

MartinKubal user is correct to suggest uninstall and reinstall, as we need to examine the version of Ranorex studio, the version of the service app, and the libraries used to instrument the application. I will give you download links to address each of these areas.

First download and install, or check the version of Ranorex studio that you are using. It is important to determine which version of studio you are using, but also what version you want to be using at this time. There is a new release of Ranorex studio that you may want to check out.

Next, as MartinKubal recommended, I would remove everything from the android device, and restart the device. Now you will go to the download link provided below, and install the service app that matches your version of Ranorex studio.

The next step is to take an uninstrumented version of your app, and attempt to instrument it with the wizard in Ranorex studio. This will help ensure the version of the library in the app matches with the version of studio that you are using.

If after that you are still having this issue, then please lengthen the connection timeout to 1 minute, or 60 seconds, to test that slow startup of the app is not the issue. Setting this to 1 minute is less important than setting it long enough for the app to start. If the app is up on the screen, and Ranorex says it timed out, then lengthen the time again to 2 minutes. You will not leave the setting this way, but this is just to test what is happening. You can change this setting in studio by going to "Settings" at the top > plugins (tab) > and then find connection timeout under mobile.

Here are the links that I promised you:

Ranorex Software Download Archive

Ranorex Mobile Application Archive

If you continue to have trouble, then please send an email to [email protected] if you are in the USA, or send email to [email protected] if you are in Europe (or world wide), and we will be happy to assist you further.

I hope this information is helpful to you, and I look forward to your response.

Sincerely,

- M. Kendall McIntosh
Automation Support Engineer
.
Image

spatil
Posts: 2
Joined: Fri Dec 08, 2017 1:35 pm

Re: Error "failed to start app" even though app was started

Post by spatil » Fri Dec 08, 2017 1:45 pm

I have encountered the same issue. Please find the configuration below

Configurations :
Ranorex version : 7.2.1
Android version : 7.0
Mobile device: Samsung Galaxy S7
Windows Version: Windows 10 Pro version- 1703

I am facing an error below while executing Tests on Ranorex

Failed to start app '<app name>' because the app started event was not received within the specified timeout of '00:00:30'.
The operation has timed out.

Code: Select all

at Ranorex.Plugin.Mobile.Device.MobileDevice.WaitForAppStartedEvent(AppInformation appInfo, TimeSpan timeout, TimeSpan waitTimeCorrection) at Ranorex.Plugin.Mobile.Device.MobileDevice.StartApplication(AppInformation app, Boolean resetInitialState) at Ranorex.Host.RunMobileApp(String deviceDisplayName, String appName, Boolean resetInitialState) at ginloTest.Startapp.Ranorex.Core.Testing.ITestModule.Run() in c:\git\clients\Ranorex-Xamarin-Android\tests\Test\Startapp.cs:line 96 at Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)

To resolve above issue I tried some workarounds which are listed below but had no luck

1. Tried to uninstall and reinstall all the ranorex services on my system and device
2. Increased the operation time out from Ranorex plug in settings
3. Checked with other devices too, but observed same issue on all android devices
4. Went back to previous version of Ranorex and tried to capture and replay same case, no luck
5. Tried with both modes USB and WiFi, no luck
6. No relevant settings found on Ranorex service app on mobile

any possible solution ?

dpFourOFour
Certified Professional
Certified Professional
Posts: 38
Joined: Mon Dec 12, 2016 9:24 am

Re: Error "failed to start app" even though app was started

Post by dpFourOFour » Thu Dec 14, 2017 1:33 pm

Hey Spatil,
1. Tried to uninstall and reinstall all the ranorex services on my system and device
2. Increased the operation time out from Ranorex plug in settings
3. Checked with other devices too, but observed same issue on all android devices
4. Went back to previous version of Ranorex and tried to capture and replay same case, no luck
5. Tried with both modes USB and WiFi, no luck
6. No relevant settings found on Ranorex service app on mobile
I'm not sure what you mean with operation time out, but in my case increasing the connect timeout and general timeout helped a lot overcoming such issues.
mob_set.jpg
mob_set.jpg (74.15 KiB) Viewed 864 times
Hope that helps!
Best,
DP
Please always include the following information to your posts
  • Ranorex Version
  • OS Version

jtoivanen
Posts: 1
Joined: Fri Dec 08, 2017 1:07 am

Re: Error "failed to start app" even though app was started

Post by jtoivanen » Tue Dec 19, 2017 10:58 pm

Hello,

I have the same problem with Source Code instrumented iOS app. The app doesn't start but if you manually start the app, recording and running tests work perfectely (RxServiceApp recognizes the app as instrumented).

If I use the Instrumentation Wizard, app starts and stops normally, but I'd prefer source code instrumentation.

I create the Source Code instrumented IPA file with Development provision certificate and debugging should be enabled.

For me it would be important to have Ranorex to start our source code instrumented app, because I'd run the tests on CI server (Jenkins) and manually instrumenting and starting every build is not very efficient. We can have multiple builds a day.

I have uninstalled and reinstalled the app multiple times, I've built it multiple times, re-instrumented couple times, rebooted Mac, iOS device and Windows machine, tried if it works over USB or WiFi (it doesn't).

Version information:
Ranorex Studio: 8
RxServiceApp: 3.0.0
Instrumentation file: libRxAutomationUni_300.a
iOS (on iPhone SE): 11.2.1
Windows: Windows 10

Any help would be much appreciated.

spatil
Posts: 2
Joined: Fri Dec 08, 2017 1:35 pm

Re: Error "failed to start app" even though app was started

Post by spatil » Thu Dec 28, 2017 4:08 pm

Hi dpFourOFour,

I tried with the solution you have mentioned, I metioned it at #2, but had no luck. I found the workaround that to launch the app first by adb cmd and then by Ranorex.Because then I get no error regarding 'Failed to start app'. I observed that Ranorex fails to start app at very first time but after that there is no issue.
But this is not a solution just a workaround.

Regards,
~Sumedha

Otter_T
Posts: 12
Joined: Mon Aug 31, 2015 5:33 pm

Re: Error "failed to start app" even though app was started

Post by Otter_T » Sat Dec 30, 2017 1:54 am

I've had this exact issue ever since release 6.2.1, and the only thing that has worked for me is setting "Android OS automation" to False in Settings/Plugins/Mobile. Something seems to have changed beginning with 6.2.1 that fundamentally altered the way Ranorex communicates with Android devices.

Losing the ability to automate against the Android OS was initially a major problem, because many of my scripts included steps to interact with the OS directly; for example, I'd created actions to handle various permissions dialogs that would pop up when the AUT was being used on a device for the first time. I was able to work around that issue by creating code modules to grant the AUT all necessary permissions via ADB commands ahead of time. As a side benefit, learning how to leverage ADB commands enabled me to automate some device configuration prerequisites that members of my test team previously had to perform manually.