What DefaultSearchTimeout parameter does?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Saha
Posts: 39
Joined: Tue Mar 01, 2011 6:20 pm

What DefaultSearchTimeout parameter does?

Post by Saha » Mon Mar 14, 2011 10:49 pm

What does the DefaultSearchTimeOut parameter do?
Does it keep trying for the webelement until it finds out with in the timeout period?

For example- If I have set Adapter.DefaultSearchTimeout = 30000
Is it going to search for element multiple times until the timeout occurs?
or
It will search only once and then wait until the timeout happens.

Pelase let me know.
Thanks,
Saha

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

Re: What DefaultSearchTimeout parameter does?

Post by Support Team » Mon Mar 14, 2011 11:02 pm

Hello Saha,

As the API documentation for that property points out, the default search timeout is the time Ranorex will search for an element when you assign a string to an Element/Adapter variable, e.g.:
Ranorex.Button button = "pathToTheButton";
On the other hand, for a repository item the search timeout of the RepoItemInfo class is used.
Every time you access an element using the code generated for a repository item, an adapter is created from the RepoItemInfo class and the RepoItemInfo search timeout is used.

For both cases Find<T> or FindSingle<T> are used internally. The search timeout is provided as parameter to these functions. With the search timeout provided these functions will search through all elements repeatedly as long as the timeout has not elapsed and will stop afterwards.

If you use these functions yourself and you don't provide a timeout parameter then the element tree is searched only once.

Regards,
Roland
Ranorex Support Team

Saha
Posts: 39
Joined: Tue Mar 01, 2011 6:20 pm

Re: What DefaultSearchTimeout parameter does?

Post by Saha » Tue Mar 15, 2011 2:28 pm

Thanks Ronald,

I just want to make sure I understand you correctly.
I have code like this in my script

Dim element As Ranorex.WebElement = Host.Local.FindSingle(".//Span@innerText="New Auto", 30000)
So I am assuming that ranorex will search for this element repeatedly for 30ms until it finds out.

Please let know if I am correct.

Thanks,
Saha

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

Re: What DefaultSearchTimeout parameter does?

Post by Support Team » Tue Mar 15, 2011 2:44 pm

Hi,

you are correct but Ranorex waits 30 seconds and not 30 milliseconds. :D

Regards,
Peter
Ranorex Team

Saha
Posts: 39
Joined: Tue Mar 01, 2011 6:20 pm

Re: What DefaultSearchTimeout parameter does?

Post by Saha » Tue Mar 15, 2011 3:30 pm

oops you got me on that:)