Increasing the Timeout of getting the Tag info thru RxPath : Automation API

Increasing the Timeout of getting the Tag info thru RxPath

Class library usage, coding and language questions.

Increasing the Timeout of getting the Tag info thru RxPath

Postby dal » Fri Nov 19, 2010 2: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...
dal
 
Posts: 72
Joined: Thu Jun 24, 2010 9:59 am

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

Postby Ciege » Fri Nov 19, 2010 5: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
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

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

Postby Support Team » Fri Nov 19, 2010 8: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

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

Postby dal » Wed Jan 12, 2011 12:46 pm

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...
dal
 
Posts: 72
Joined: Thu Jun 24, 2010 9:59 am


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests