Performance for FindSingle(..)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
dareim
Posts: 9
Joined: Tue Apr 22, 2008 8:19 am

Performance for FindSingle(..)

Post by dareim » Tue Jan 20, 2009 8:42 am

Hello all

I have a performance issue with following:

WebElement el = ACADoc.FindSingle(...);

The page which contains this element is very large.
It is not the problem, that Ranorex cannot find the element - this works fine. But it takes a very long time (about 10 sec. in my case).
The element is in a top section of the page.
It seems like Ranorex scans the whole page till the end, even if the element is found already.

Is there a solution to make this faster?

Thanks & regards

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Tue Jan 20, 2009 10:17 am

Do you use Ranorex 1.5 or Ranorex 2.0? I can't tell from the code snippet you posted :-)

Ranorex 2.0:
In earlier Ranorex Preview versions (up to Build 4977) the FindSingle method did search the whole subtree even if it already found a matching element.
This issue has been fixed for the current Ranorex 2.0 RC1 version, downloadable from our homepage.

Ranorex 1.5:
You are right, WebElement.FindSingle just calls WebElement.Find and returns the first element in the list of found elements. To minimize search time try using non-optimized paths, i.e. paths that don't inlcude placeholders like "//" or "*". Or try splitting up the search, i.e. don't always search from the root web element, but from some inner element that you found before.

Regards,
Alex
Ranorex Support Team

dareim
Posts: 9
Joined: Tue Apr 22, 2008 8:19 am

Post by dareim » Tue Jan 20, 2009 12:13 pm

Hi Alex

I work with 1.5.
I tried to use non-optimized paths and I have seen that this works much faster!
I miss-interpreted the label in the WebSpy [Optimize (slower)]. I thought this 'slower' is to the recording of the page elements.

Anyway, as soon as update prices (Ranorex 1.5 to 2.0) are available, I try to switch to the newest version.

But for the moment, I can work with the actual release in a absolute satisfactory manner!

Thanks & regards,
Daniel

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Tue Jan 20, 2009 12:30 pm

The "slower" in "Optimize (slower)" is true for building the path as well as for interpreting it. The advantage is though that the path is usually shorter and may be more robust regarding changes in the application.
dareim wrote: But for the moment, I can work with the actual release in a absolute satisfactory manner!
Glad to hear that! :-)

Regards,
Alex
Ranorex Support Team