DefaultSearchTimeout

Ask general questions here.
User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

DefaultSearchTimeout

Post by sdaly » Tue May 18, 2010 8:57 am

Hi

I have set adapter.DefaultSearchTimeout = 10000 in the main class.

I am then searching for the following which is a search result after a search button is clicked. The result is returned within 2 seconds, however I get a Ranorex.ElementNotFoundException: No element found for path error, unless I put a delay in such as delay.seconds(4)

Dim selector As Ranorex.ATag = host.Local.FindSingle("/dom[@caption='Central Vision']/frameset/frameset/frame[@id='main']/frameset/frame[@name='search_display']/body/div[@id='pat_details_layer']/table/tbody/tr/td/table/tbody/tr/td[@innertext='" & surname & "']/../../../../../td[@innertext='" & forename & "']/../td/table/tbody/tr/td/a[@innertext='" & chi & "']")

selector.Click

Am I using the defaultSearchTimeout in the wrong way? Preferable I wouold like to remove all delays so the tests can run most efficiently...

Thanks
Scott

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: DefaultSearchTimeout

Post by sdaly » Tue May 18, 2010 10:18 am

Ahhh, just read a thread which tells me the findSingle method does not use the timeout by default! I've now passed the timeout in and it works without the delays!

This now works!

Dim selector As Ranorex.ATag = host.Local.FindSingle("/dom[@caption='Central Vision']/frameset/frameset/frame[@id='main']/frameset/frame[@name='search_display']/body/div[@id='pat_details_layer']/table/tbody/tr/td/table/tbody/tr/td[@innertext='" & surname & "']/../../../../../td[@innertext='" & forename & "']/../td/table/tbody/tr/td/a[@innertext='" & chi & "']", Adapter.DefaultSearchTimeout)
selector.Click

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

Re: DefaultSearchTimeout

Post by Support Team » Tue May 18, 2010 10:29 am

Hi!

Nice to hear that it works now.
Here are two documentation links about this issue
http://www.ranorex.com/support/user-gui ... html#c2480
http://www.ranorex.com/Documentation/Ra ... imeout.htm

Regards,
Peter
Ranorex Support Team