Increasing the Timeout of getting the Tag info thru RxPath

Class library usage, coding and language questions.
dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Increasing the Timeout of getting the Tag info thru RxPath

Post by dal » Fri Nov 19, 2010 1:09 pm

Hi Team,

Dim Image1 As ImgTag
Image1 = "/dom[@domain~'1.2.3.*']/.//img[@id='imgLogo']"

Here the Default Timeout is 10 seconds only.
But there are times this image will be displayed after 10secs, in that case the test step is failing.
Can anyway we can increase this to 30 seconds?

I know how that can be accomplished in Repository, not sure how we can do this in desc prog style.

Regards,
Dal...

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Increasing the Timeout of getting the Tag info thru RxPath

Post by Ciege » Fri Nov 19, 2010 4:10 pm

You can put your search in a loop. While !True loop. So have your code wait for the object to appear. Also, put a timer in your loop that if it hasn't appeared after X seconds to fail out of the loop.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

Re: Increasing the Timeout of getting the Tag info thru RxPath

Post by Support Team » Fri Nov 19, 2010 7:11 pm

The approach recommended by Ranorex is to use the built in timeout functionality:
Image1 = Host.Local.FindSingle("/dom[@domain~'1.2.3.*']/.//img[@id='imgLogo']", 30000)
Just specify the time you want to search for the path for the "timeout" parameter (30 seconds in the example above). Using the timeout parameter does not change the default timeout value, it's only used for this call of the FindSingle method.

Regards,
Alex
Ranorex Team
.
Image

dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Re: Increasing the Timeout of getting the Tag info thru RxPath

Post by dal » Wed Jan 12, 2011 11:46 am

Add the following statment into your Main method will increase the Default timeout from 10s to 30s

Code: Select all

Adapter.DefaultSearchTimeout = 30000
This is the simplest way of doing this without modifying the existing code.

Regards,
Dal...