Page 1 of 1

Increasing the Timeout of getting the Tag info thru RxPath

Posted: Fri Nov 19, 2010 1:09 pm
by dal
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...

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

Posted: Fri Nov 19, 2010 4:10 pm
by Ciege
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.

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

Posted: Fri Nov 19, 2010 7:11 pm
by Support Team
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

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

Posted: Wed Jan 12, 2011 11:46 am
by dal
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...