Hi
I am interested in learning how I can use ranrorex so that lookup for an element is quicker than it currently is. Essentially, I would like to know if the element with a certain charecteristic exists or not :
For eg, I am looking for an element with unknown row index and known text, and the code tries look for this item by looking if the item exists with different values of row id.
within for loop, search till you find:
{
RepoItem = ..?/?/row[@index=$rownumber]/cell[@text="<known text string>"];
if(RepoItem.Exists)
{
break;
}
}
I cannot use just the text string to identify that element, since there are multiple entries in the same table and I need to search for that cell within certain range of indices to find it. RepoItem.Exists, takes some time to confirm if the element exists or not, how can I shorten this time.
Please let me know
How to speed up the lookup for a ui element?
Re: How to speed up the lookup for a ui element?
Hi,
Unfortunately, without seeing your app or at very least Ranorex snapshot (NOT screenshot) of the problematic table, there is not much anyone here can do or suggest. Any chance you can provide us with either working sample or snapshot?
Unfortunately, without seeing your app or at very least Ranorex snapshot (NOT screenshot) of the problematic table, there is not much anyone here can do or suggest. Any chance you can provide us with either working sample or snapshot?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to speed up the lookup for a ui element?
Hiodklizec wrote:Hi,
Unfortunately, without seeing your app or at very least Ranorex snapshot (NOT screenshot) of the problematic table, there is not much anyone here can do or suggest. Any chance you can provide us with either working sample or snapshot?
Its a table with various elements coded using mfc. The absolute of the element being looked for would be
/form[@title='<knowntitle>' and @processname='<knownprocessname>'' and @class='<knownstring>']/?/?/row[@index='<unknownindex>']/cell[@text>'<known text name>']
If know the row index I can find this. This is the xpath I need to use to confirm if the element exists or not. It takes a long time to confirm that the element does not exist , if the index provided is not the correct one. I am trying to look for the element, with various values of @index so that i can find the right walue of @index, for which this element exists.
Would this help ?
Thanks,
Re: How to speed up the lookup for a ui element?
Hi,
There is no way to speed-up the lookup for an element. I mean, the speed of search depends on the quality of xpath. If the xpath is unique enough, the speed of search should be relative quick. However, if the element does not exists, Ranorex tries to search for the element its entire Effective Timeout, which is a sum of all Search Timeouts of all parents above the actual element. The only way how to "speedup" Exists method is to add a timeout parameter, like this...
But remember that too short timeout could return incorrect result, because if the timeout is too short, Ranorex may not find an existing element
There is no way to speed-up the lookup for an element. I mean, the speed of search depends on the quality of xpath. If the xpath is unique enough, the speed of search should be relative quick. However, if the element does not exists, Ranorex tries to search for the element its entire Effective Timeout, which is a sum of all Search Timeouts of all parents above the actual element. The only way how to "speedup" Exists method is to add a timeout parameter, like this...
Code: Select all
...
if(RepoItem.Exists(30000))
...
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to speed up the lookup for a ui element?
Thanks, that certainly helps !!! Additional question, how does caching a ui element affect this ? Is there a way to enable/disable caching when code is executed or within a code module.
Thanks,
Thanks,
odklizec wrote:Hi,
There is no way to speed-up the lookup for an element. I mean, the speed of search depends on the quality of xpath. If the xpath is unique enough, the speed of search should be relative quick. However, if the element does not exists, Ranorex tries to search for the element its entire Effective Timeout, which is a sum of all Search Timeouts of all parents above the actual element. The only way how to "speedup" Exists method is to add a timeout parameter, like this...But remember that too short timeout could return incorrect result, because if the timeout is too short, Ranorex may not find an existing elementCode: Select all
... if(RepoItem.Exists(30000)) ...
Re: How to speed up the lookup for a ui element?
Hi,
I'm not quite sure, if there is a way to globally disable cache for all (already generated) repo elements? I think you will have to do it element by element. The code to disable cache looks like this:
Enabled cache should improve the speed of search for element. So if you disable it, it may slow the search
I'm not quite sure, if there is a way to globally disable cache for all (already generated) repo elements? I think you will have to do it element by element. The code to disable cache looks like this:
Code: Select all
repo.FolderName.UseCache=false;
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 1
- Joined: Mon Jun 04, 2018 2:18 pm
Re: How to speed up the lookup for a ui element?
Will this involve the cache memory of the system or create a false cache using the permanent memory?odklizec wrote:Hi,
I'm not quite sure, if there is a way to globally disable cache for all (already generated) repo elements? I think you will have to do it element by element. The code to disable cache looks like this:Enabled cache should improve the speed of search for element. So if you disable it, it may slow the searchCode: Select all
repo.FolderName.UseCache=false;
If there were no humor, life would be tragic.
Re: How to speed up the lookup for a ui element?
Hi,
To be honest, I don't have a clue? I guess it simply stops caching elements under pointed repo folder and every time the folder is accessed, Ranorex refreshes its content.
To be honest, I don't have a clue? I guess it simply stops caching elements under pointed repo folder and every time the folder is accessed, Ranorex refreshes its content.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration