Anytime a wildcard (?) or optional element (//) is used, Ranorex has to search every possible path under the parent until it either (a) finds the element or (b) reaches the COMBINED search timeout.
So, for example, if you have the following structure:
Code: Select all
<dom>
<body>
<div>
<div/>
</div>
<div/>
<div>
<div id='myDiv'/>
</div>
</body>
</dom>
You would have the following paths, in order of greatest to least potential search times:
/dom[@domain='test.mydomain.com']//div[@id='myDiv'] -> Will search EVERY child under dom, and each child's children, recursively (i.e., it will search the whole dom structure), until it finds a div matching the id 'myDiv', or the search times out.
/dom[@domain='test.mydomain.com']/body/?/div[@id='myDiv'] -> Will search the dom for a body tag, and each child under body, and each child's children, to ONE level depth ONLY (i.e., it will just search one level deep in the structure under the body tag), until it finds a div matching the id 'myDiv', or the search times out.
/dom[@domain='test.mydomain.com']/body/div/div[@id='myDiv'] -> Will search the dom for a body tag, then it will search that body tag for each div. Then in each div, it will search until it finds a div matching the id 'myDiv', or the search times out.
/dom[@domain='test.mydomain.com']/body/div[3]/div[@id='myDiv'] -> Will search the dom for a body tag, then it will search that body tag for the 3rd div, then it will search the 3rd div for the div with the id 'myDiv'. (Try not to use indexes if possible, as they can become volatile as the developers move things around in the SUT.)
So, try to make your paths as specific as possible.
NOTE: If you use a unique ID (div[#'myDiv'] it will find it much more quickly since the unique id is hashed in a way that makes it easier to find, so Ranorex doesn't need to search recursively. This is why you should always try to use unique ids when available.