The app currently running on the device doesn't match

Mobile Testing, Android App Testing.
ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

The app currently running on the device doesn't match

Post by ngrishakin » Wed Oct 09, 2013 8:06 pm

My Android tests (Ranorex 4.1.1) native android app running on S3. I have set of tests and each test starts the app, does something and closing the app. Randomly some tests will fail with the following error when app starts. Device still has 410.apk ranorex service installed. I did not see new 411.apk yet.

The app currently running on the device '' doesn't match the started app ''.
Show/Hide Stacktrace
at Ranorex.Plugin.Mobile.MobileDevice.StartAndInitDeviceApplication(AppInformation app) at Ranorex.Plugin.Mobile.MobileDevice.StartApplication(AppInformation app) at Ranorex.Host.RunMobileApp(String deviceDisplayName, String appName) at Elvis_Week_android.OpenSchedule_3.Ranorex.Core.Testing.ITestModule.Run() in c:\Users\Developer\Documents\Ranorex\RanorexStudio Projects\Elvis_Week_android\Elvis_Week_android\OpenSchedule_3.cs:line 82 at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext)

Thanks!

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

Re: The app currently running on the device doesn't match

Post by Support Team » Thu Oct 10, 2013 2:24 pm

Hello,

The current Ranorex Service app has version 4.1.0.

Have you instrumented your app using Ranorex 4.1.1?
How do you close your app?
Please try add a short delay before you restart your app?

Regards,
Markus (T)
.
Image

ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

Re: The app currently running on the device doesn't match

Post by ngrishakin » Thu Oct 10, 2013 2:53 pm

Yes, app is instrumented with 4.1.1
I close my app with: repo.ComSeedlabsElvisweek.MainActivity1.PressKeys("{BACK}");
After that Delay.Milliseconds(1000);

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

Re: The app currently running on the device doesn't match

Post by Support Team » Fri Oct 11, 2013 10:41 am

Hello,

Please try to close your app using 'Host.Local.CloseApplication()'.
You could try to increase the timeout to a higher value (e.g. 5000ms).

Regards,
Markus (T)
.
Image

ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

Re: The app currently running on the device doesn't match

Post by ngrishakin » Fri Oct 11, 2013 9:45 pm

Markus, I cannot edit or insert code to .cs file created by recording. I guess I need to add it somehow to the second file ...UserCode.cs where I can overwrite methods from recording file. Can you let me know the best practices?
Thanks,
Nikolay

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

Re: The app currently running on the device doesn't match

Post by Support Team » Tue Oct 15, 2013 6:13 pm

Hello,

That's right.
You would need to edit the <Recording>.UserCode.cs file for that purpose.

We recommend to add this action in your Recording module.
You could drag & drop your Repository Item from the repository into your action table (select 'Close Application > Close Window'.

Regards,
Markus (T)
.
Image