Page 1 of 1

Searching for a web element takes ~ 25 seconds

Posted: Sun Jun 19, 2011 9:02 pm
by liortal
Hi all,

We are using Ranorex to automate various activities across all product suites in the company.

While working on some web component, i've encountered an issue with identifying an element on the page.

The XPath to the element is something similar to:

body/div/div[@id='SuiteNavigation']/div/div[@id='systemApplications']/table/tbody/tr/td[14]

On another scenario the same element has this path:

body/div[@id='SuiteNavigation']/div/div[@id='systemApplications']/table/tbody/tr/td[14]

In order to keep my code consistent, i've looked for a proper generic way to have both options valid under a single repository item, which led me to have this:

body//div[@id='SuiteNavigation']/div/div[@id='systemApplications']/table/tbody/tr/td[14]

The original item identification takes ~ 1 second
With // (match any descendant) it takes ~ 25 seconds.

Is there a way to improve on this, as this is unacceptable performance from our side?

Thanks
Lior

Re: Searching for a web element takes ~ 25 seconds

Posted: Tue Jun 21, 2011 3:05 pm
by Support Team
Hi,

I'm sorry but here is no other solution for a RanoreXPath fitting both paths.
By using // (match any descendant) all descendants of the outgoing node will be gone through, which, of course, takes some time.
Another possibility is to use the exact path, which will make the automation faster.
Or maybe following forum posts will help you:
http://www.ranorex.com/forum/performanc ... t1155.html
http://www.ranorex.com/forum/cachesession-t1685.html

Regards,
Tobias
Support Team

Re: Searching for a web element takes ~ 25 seconds

Posted: Wed Jun 22, 2011 4:15 pm
by liortal
Hi, thanks for replying!

Is there an option to define a search, where a "find all descendants" is performed, however, upon FIRST MATCH, the result will be returned?

Can this be raised as some suggestion for future versions? if so, how ?

Re: Searching for a web element takes ~ 25 seconds

Posted: Wed Jun 22, 2011 6:14 pm
by Support Team
liortal wrote:Is there an option to define a search, where a "find all descendants" is performed, however, upon FIRST MATCH, the result will be returned?
This is already the default behavior for all "FindSingle" methods, i.e. for all repository operations. Only the "Find" methods return a list of all elements complying to the specified RanoreXPath.

I guess the problem is not that so many items are found, but that too many elements are searched.

Regards,
Alex
Ranorex Team