Issue running test after "adb reboot"

Ranorex Studio, Spy, Recorder, and Driver.
kunwar
Posts: 6
Joined: Thu Jun 13, 2013 9:22 am

Issue running test after "adb reboot"

Post by kunwar » Thu Jul 18, 2013 10:11 am

Hi,

I am facing some issue accessing android app after rebooting my device with "adb reboot" command during the tests.
To exaplain, I have 2 apps lets say A.apk and B.apk. Both have been instrumented and installed on the device.
When I launch A.apk and after performing some tests on it, I issue a "adb reboot" command and then B.apk launches automatically as per the flow and then I need to run some tests on B.apk. But the issues here is after reboot when B.apk is launched automatically on my android device, ranorex is not able to find any elements on the same and tests fail.
Also, i tried explicitly launching B.apk after reboot but still it does not works and I get an error "No compatible apps found".
i have checked ranorex service as well and it is running after adb reboot. I checked this by issuing ps command and looking for the ranorex service.

Can you please help me with this and suggest why this is not working. Thanks in advance.

Regards,
Kunwar

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

Re: Issue running test after "adb reboot"

Post by Support Team » Fri Jul 19, 2013 1:20 pm

Hello,

Do you have 'Autostart' enabled for Ranorex service on your device?
Could you please post the complete error message that you get
Is it possible to ping your device after reboot?

What happens if you try to explicitly launch A.apk?
Do you get the same error message?
Could you please try to launch B.apk manually and record a few actions?

Regards,
Markus (T)

kunwar
Posts: 6
Joined: Thu Jun 13, 2013 9:22 am

Re: Issue running test after "adb reboot"

Post by kunwar » Tue Jul 23, 2013 11:24 am

Hi Markus,

'Autostart' is enabled.
After reboot, in an ideal case when B.apk is launched automatically, a toast message is shown on the device as "Ranorex service did not respond. Please make sure they are installed and running". If now, i try to select any item in the app B.apk which is launched automatically after reboot, it fails to find any of the elements, thus the script does not works.
Now, if after reboot, I explicitly launch A.apk or B.apk, I get the following error mesage on console "Failed to get ranorex compatible app from the device".
This is not the expected response as all the apps were instrumented intitally and copied on the device.

One more noteworthy point here is that, the problem is coming only if my script issues "Adb reboot". If there is no "Adb reboot" command in the scripts, then B.apk when explicitly launched is accesible via script and works fine.

Please help me here and let me know if you need any other information from my side.

Thanks,

Kunwar

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

Re: Issue running test after "adb reboot"

Post by Support Team » Wed Jul 24, 2013 12:49 pm

Hello,

If you call 'adb reboot', you will disconnect the adb connection from Ranorex to your device.
In that case, you would need to re-connect to your device again.
This is the reason why you got error messages.

Please try to re-connect your device.

Regards,
Markus (T)

kunwar
Posts: 6
Joined: Thu Jun 13, 2013 9:22 am

Re: Issue running test after "adb reboot"

Post by kunwar » Thu Jul 25, 2013 6:43 am

Hi Markus,

By reconnect do you mean to plug out and then plug in the device back to the system Or is there any way to programmatically reconnect the device with Ranorex?

Thanks,

Kunwar

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

Re: Issue running test after "adb reboot"

Post by Support Team » Fri Jul 26, 2013 3:25 pm

Hello,

In Ranorex Studio, you could open the 'Devices view', select your device and click on 'Retry' to re-connect to your device. There is another (hidden) way to do that problematically but it's not recommended at all.
We couldn't guarantee for any side effects.
If you really want to use this method, please write an email to [email protected].

Regards,
Markus (T)