How to retry connect to mobile device from code

Class library usage, coding and language questions.
Oksana
Posts: 64
Joined: Tue Jan 15, 2013 10:20 am

How to retry connect to mobile device from code

Post by Oksana » Tue Oct 01, 2013 7:08 am

Hello!

The problem states in following: while running tests for a long time on the mobile device (6 hours and longer), Ranorex sometimes stops see the application and none of the repository elements can be found (exception 'Failed to find item *', 'No element found for path * within 2m.'). All starts work again only after pressing on the 'Devices' -> 'Retry' button. Changing of mobile connect timeout or element search timeout values doesn't better the situation.

So, is there some functionallity to perform retry to connect to device programmatically from code?

Ranorex version 4.1.0
Mobile app type - android native.
Connection to device via USB.

Thanks in advance,
Oksana

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

Re: How to retry connect to mobile device from code

Post by Support Team » Tue Oct 01, 2013 3:06 pm

Hello,

There is another (hidden) way to do that problematically but it's not recommended at all.
We couldn't guarantee for any side effects, though.
If you really want to use this method, please write an email to [email protected].

Regards,
Markus (T)
.
Image

Oksana
Posts: 64
Joined: Tue Jan 15, 2013 10:20 am

Re: How to retry connect to mobile device from code

Post by Oksana » Thu Feb 06, 2014 11:17 am

Hi,

Is it possible to reconnect mobile device after 'System.TimeoutException' ('Device communication timed out. Either no instrumented application is running on the device or the device was not able to process the request within the specified timeout of '00:00:15'. Check that an instrumented application is running on the device or try to increase the timeout.') from code?

The thing is that adviced method doesn't help to reconnect device after such exception.

Thanks,
Oksana

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

Re: How to retry connect to mobile device from code

Post by Support Team » Mon Feb 10, 2014 5:42 pm

Hello Oksana,

As Markus already wrote, this is not recommended by Ranorex and that's the reason that we cannot post the workaround in the forum.
I suggest to increase the connection timeout in the plugins tab in the general settings dialog in Ranorex Studio.
Thank you for your understanding.

Regards,
Bernhard
.
Image

Oksana
Posts: 64
Joined: Tue Jan 15, 2013 10:20 am

Re: How to retry connect to mobile device from code

Post by Oksana » Tue Feb 11, 2014 7:49 am

Thanks