We have some UI tests using Ranorex. To catch the performance of UI, we use stop watch. Bellow is the sample code. Right after click, we start the stopwatch. When one of feature(xpath) exists, we stop the stopwatch. But the problem is, we run the same tests every day multiple times. one or two times out of 10 times, we will see the time that stopwatch catches is much longer than what it should be. Normally it takes 4 seconds to load the page with code bellow. But sometimes we see 10, 13 seconds. During those slow time, I observed the test. The UI page has been fully loaded. But Ranorex still shows "searching item xxxx". Why Ranorex couldn't identify the xpath right away when the page has been fully loaded?
repo.Iexplore.Create_Action.Click("Center");
stopwatch.Start();
Validate.Exists(repo.JudicialSummaryApplication.Artifact_Content.Individual_Features.Universal_Summary.Paragraph_ContentInfo);
stopwatch.Stop();
Ranorex slow to identify the xpath
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex slow to identify the xpath
Hi Zhiqiu,
In general Ranorex is a GUI automation tool and not designed to do performance test, but such differences in searching an element can be caused by several factors.
One factor could be that the path is not robust enough to identify the element uniquely. Please also note that different processes, which need a lot of resources, can influence the search.
May I ask you to upload a Ranorex Snapshot and a corresponding RanoreXPath of such an element in question? This would allow us to check if the path is robust and unique enough.
Thank you.
Regards,
Markus (S)
In general Ranorex is a GUI automation tool and not designed to do performance test, but such differences in searching an element can be caused by several factors.
One factor could be that the path is not robust enough to identify the element uniquely. Please also note that different processes, which need a lot of resources, can influence the search.
May I ask you to upload a Ranorex Snapshot and a corresponding RanoreXPath of such an element in question? This would allow us to check if the path is robust and unique enough.
Thank you.
Regards,
Markus (S)
Re: Ranorex slow to identify the xpath
Hi Markus,
Bellow is the xpath we tried to validate. It's a flex object.
.//div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.universalHierarchyDialog']/flexobject[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.universalHierarchyWidgetSwfObject']
Bellow is the xpath we tried to validate. It's a flex object.
.//div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.universalHierarchyDialog']/flexobject[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.universalHierarchyWidgetSwfObject']
You do not have the required permissions to view the files attached to this post.
Re: Ranorex slow to identify the xpath
Hi,
I think the problem is in the complicated and automation unfriendly structure of your AUT, which makes unique identification of the element in question pretty hard. Because of the use of .// syntax, Ranorex is forced to search the element div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.universalHierarchyDialog'] in all descendants of the current element (from where it start search). The more descendants there are, the longer it can take. Additionally, the use of regex probably does not help the situation either? But I guess it has much smaller impact on search performance than using // syntax.
So if you want to speed the search up, you will have to add some more elements to the path, like the nearest parent(s) of searched element. But looking at the structure of your AUT, you will most probably have to use some indexes, which are prone to changes and not very recommended to use.
BTW, it would be much easier to help you to find a reliable (faster) path, if you could post a Ranorex snapshot! Using screenshot for constructing xpaths is useless
I think the problem is in the complicated and automation unfriendly structure of your AUT, which makes unique identification of the element in question pretty hard. Because of the use of .// syntax, Ranorex is forced to search the element div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.universalHierarchyDialog'] in all descendants of the current element (from where it start search). The more descendants there are, the longer it can take. Additionally, the use of regex probably does not help the situation either? But I guess it has much smaller impact on search performance than using // syntax.
So if you want to speed the search up, you will have to add some more elements to the path, like the nearest parent(s) of searched element. But looking at the structure of your AUT, you will most probably have to use some indexes, which are prone to changes and not very recommended to use.
BTW, it would be much easier to help you to find a reliable (faster) path, if you could post a Ranorex snapshot! Using screenshot for constructing xpaths is useless

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: Ranorex slow to identify the xpath
The attachment is the snapshot. Thanks for your help.
I did try to attach the snapshot. Not sure if you see it. Please let me know if you can't view it.
I did try to attach the snapshot. Not sure if you see it. Please let me know if you can't view it.
Re: Ranorex slow to identify the xpath
Hi,
No, there seems to be no snapshot attached to your post. Maybe it's too big to be attached (bigger than 3MB)? In this case, use a cloud service (dropbox, onedrive, google drive, etc...) to upload your snapshot and post here a link.
No, there seems to be no snapshot attached to your post. Maybe it's too big to be attached (bigger than 3MB)? In this case, use a cloud service (dropbox, onedrive, google drive, etc...) to upload your snapshot and post here a link.
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: Ranorex slow to identify the xpath
Here is the link to the snapshot. Thanks!
https://drive.google.com/file/d/0B8axhw ... sp=sharing
https://drive.google.com/file/d/0B8axhw ... sp=sharing
Re: Ranorex slow to identify the xpath
I also screenshot the repository. the highlighted on is the problem. Please advice what I can do so Ranorex speedup the validation.
You do not have the required permissions to view the files attached to this post.
Re: Ranorex slow to identify the xpath
Hi,
As I've suspected, your application is automation unfriendly
A lot of DIVs in the same folder with no IDs. Using element indexes would be a very risky job, most probably failing with pretty minor GUI changes. Unfortunately, using element classes (as I did in the path below) could be only a minor improvement over the indexes.
The best path you can probably try is something like this...
./body/div[@class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable']/div[@class='ui-dialog-content ui-widget-content']/div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.universalHierarchyDialog']
As I've suspected, your application is automation unfriendly

The best path you can probably try is something like this...
./body/div[@class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable']/div[@class='ui-dialog-content ui-widget-content']/div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.universalHierarchyDialog']
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: Ranorex slow to identify the xpath
Thank you very much!! I updated the xpath as you suggested. Ranorex found the xpath right away.
Below is another xpath.
div[2]/div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.featuresWidget']/flexobject[@id='judicialsummary.FeaturesWidget']//container[@id='featuresMode']/container[@id='box']/list[@automationname='FeaturesWidget.summaryFeaturesList']//container[@type='Group']
The xpath above is under the folder with xpath body/div[4].
Do I need to change that xpath to use "@class"(see below) too? which one is better?
body/div[@class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable']/div[@class='ui-dialog-content ui-widget-content']/div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.featuresWidget']/flexobject[@id='judicialsummary.FeaturesWidget']//container[@id='featuresMode']/container[@id='box']/list[@automationname='FeaturesWidget.summaryFeaturesList']//container[@type='Group']
Below is another xpath.
div[2]/div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.featuresWidget']/flexobject[@id='judicialsummary.FeaturesWidget']//container[@id='featuresMode']/container[@id='box']/list[@automationname='FeaturesWidget.summaryFeaturesList']//container[@type='Group']
The xpath above is under the folder with xpath body/div[4].
Do I need to change that xpath to use "@class"(see below) too? which one is better?
body/div[@class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable']/div[@class='ui-dialog-content ui-widget-content']/div[@id~'[0-9]+_judicialsummary.trialCourtOrderSummaryPage.section.widget.featuresWidget']/flexobject[@id='judicialsummary.FeaturesWidget']//container[@id='featuresMode']/container[@id='box']/list[@automationname='FeaturesWidget.summaryFeaturesList']//container[@type='Group']
Re: Ranorex slow to identify the xpath
Unfortunately, there is nothing else unique enough (other than "class") in your gui, so yes, the class you picked is probably the best you can try? 

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