Page 1 of 1

What DefaultSearchTimeout parameter does?

Posted: Mon Mar 14, 2011 10:49 pm
by Saha
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

Re: What DefaultSearchTimeout parameter does?

Posted: Mon Mar 14, 2011 11:02 pm
by Support Team
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

Re: What DefaultSearchTimeout parameter does?

Posted: Tue Mar 15, 2011 2:28 pm
by Saha
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

Re: What DefaultSearchTimeout parameter does?

Posted: Tue Mar 15, 2011 2:44 pm
by Support Team
Hi,

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

Regards,
Peter
Ranorex Team

Re: What DefaultSearchTimeout parameter does?

Posted: Tue Mar 15, 2011 3:30 pm
by Saha
oops you got me on that:)