Can't get my app to launch via running script

Mobile Testing, Android App Testing.
User avatar
Aracknid
Posts: 365
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Can't get my app to launch via running script

Post by Aracknid » Fri May 10, 2019 7:20 pm

Hi,

Using Ranorex 9.0.1

I'm having an issue getting my script to start the mobile app on my AVD. Everything is setup and working as far as I can tell. I changed the plug-in settings for connection timeout to 1 minute and also I changed a few other items her to have longer timeouts.

- I added a recording module to a new solution.
- I clicked record, and in the dialog that appears I picked my AVD (endpoint) and my mobile app which is instrumented and deployed and appearing in the RxServiceApp.
- On the device, the app is not running
- When I click Create, it immediately starts my app on the AVD
- At this point Spy starts. I close spy and go look at my first step in my recording module. It looks correct, has the entry Run mobile app, Current Endpoint, com.MyAppName.mobile2
- I switch to the AVD and close my app.
- Back in Ranorex, I run the step it just created. I get the following error:

Device WaitFor(DeviceConnected) timed out. ConnectTimeout: 00:01:00
at Ranorex.Plugin.Mobile.Device.MobileDevice.WaitFor(ChannelState state)at Ranorex.Plugin.Mobile.Device.MobileDevice.ShouldRestartApp(AppInformation app, Boolean resetInitialState)at Ranorex.Plugin.Mobile.Device.MobileDevice.StartApplication(AppInformation appInfo, Boolean resetInitialState)at Ranorex.Host.RunMobileApp(String deviceDisplayName, String appName, Boolean resetInitialState)at MyApp.MyApp.Recording1.Run() in C:\Users\xxx\Local Documents\Ranorex\MyApp\MyApp\MyApp\Recording1.vb:line 80at Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)

How can I get this to run?

Thanks,

Aracknid
Last edited by Aracknid on Wed May 22, 2019 2:34 pm, edited 1 time in total.

User avatar
Aracknid
Posts: 365
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Can't get my app to launch via running script

Post by Aracknid » Tue May 14, 2019 7:01 pm

Hmm... it started working today. Perhaps due to rebooting laptop.

Don't need help now. :)

Aracknid.
Last edited by Aracknid on Wed May 22, 2019 2:34 pm, edited 1 time in total.

User avatar
Aracknid
Posts: 365
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Can't get my app to launch via running script

Post by Aracknid » Tue May 14, 2019 10:24 pm

OK, something weird is happening, and I don't understand if I just don't get something, or if there is some sort of config issue, or a bug in Ranorex.

On a clean start of the AVD and not running my app at all, it will work fine. Once my app has run and then the app is closed (either via an action in my teardown section to close the app or if I manually go to the AVD and close it) it will no longer run. I can force it to work by either restarting the RanorexService or restarting the phone (which obviously restarts RanorexService) and the reconnecting the endpoint. But this doesn't make sense to have to do.

If I leave my app running and DON'T close it when my test case runs, it will work if I re-run the test case. The first thing the test case does is to start my app and the variable to Restart App is set to true. Weird... what's the difference? If at any point I go on the phone and show running tasks and swipe it up to 'kill' it, it won't work, or if I let the test case close the app, it also won't work.

Any thoughts?

Aracknid.
Last edited by Aracknid on Wed May 22, 2019 2:34 pm, edited 1 time in total.

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

Re: Can't get me app to launch via running script

Post by odklizec » Wed May 15, 2019 7:47 am

Hi Aracknid,

Well, there is something fishy about Android enpoints connection. I'm recently automating an Android app, and even though the phone is connected directly to my laptop (via USB), it frequently fails to start the app, typically right after previous test run. The endpoint says connected, 'Restart app' parameter is 'True', but the app does not start at all. And I need to reconnect the USB cable, eventually restart Studio. Both helps.
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
Aracknid
Posts: 365
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Can't get my app to launch via running script

Post by Aracknid » Wed May 22, 2019 2:43 pm

I've logged a support request to have them look into this. It's becoming annoying to have to constantly force stop and restart the RxService on the device.

Aracknid