Default Property to use when generating RxPaths
Default Property to use when generating RxPaths
In one of my applications, when I track a Form with RanorexSpy to obtain the RxPath, by default it returns an RxPath with the "Controlid" property. Are there any settings available to change the default behaviour? (ie, to always return an RxPath with the Form's Title, or other property, instead of Controlid?)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Default Property to use when generating RxPaths
There are such settings in the Ranorex Core framework, however, right now those settings are only settable in code. We plan to add a configuration tool that allows you to favorise the attributes used in RxPaths for certain elements.
Currently, we are gathering requirements for that tool. We already have a plugin in development that provides some of the functionality the final tool should have. Using this plugin you could achieve the behavior you want, i.e. use the Title attribute by default instead of the ControlId, by editing an XML configuration file. Please, contact support_at_ranorex.com directly to get a preview of this plugin and an instruction on how to use it!
Regards,
Alex
Ranorex Support Team
Currently, we are gathering requirements for that tool. We already have a plugin in development that provides some of the functionality the final tool should have. Using this plugin you could achieve the behavior you want, i.e. use the Title attribute by default instead of the ControlId, by editing an XML configuration file. Please, contact support_at_ranorex.com directly to get a preview of this plugin and an instruction on how to use it!
Regards,
Alex
Ranorex Support Team
Re: Default Property to use when generating RxPaths
Thank you very much. The plugin works like a charm! 

Re: Default Property to use when generating RxPaths
Is there now a setting to prevent Ranorex from assigning ControlIds?
Re: Default Property to use when generating RxPaths
Hi,
Yes, it's already possible to change the path (element) weights in Ranorex. You can do this via Spy tool - click the "Edit Path Weights" link in the right bottom corner of the Spy window... Or via Global Settings dialog... Surprisingly, there is not much information about Path Weights editing in the user guide? But it's relative easy to master.
The basic idea is that all attributes are assigned with the weight value. The higher the weight value is, the higher priority is assigned to the attribute. Default weight values were set by Ranorex team, but you can easily create your own path weight rules, where you can override these values. For example, the Native Window ControlID has default value 108, which is the highest weight value from all Native Window attributes. So If you want to make another attribute a higher priority, follow these steps...
1) create a new rule
2) select the attribute you wish to set higher priority
3) enter the weight value higher than actual ControlID value (e.g. 120)
4) make sure your new rule is enabled
5) confirm changes That's all. If you now use Spy or recorder, WindowText will be used as a primary Native Window attribute.
Another way, instead of increasing the attribute weight, is to decrease the weight value of the attribute you wish to make a lower priority. Steps are the same as above. Hope this helps?
Yes, it's already possible to change the path (element) weights in Ranorex. You can do this via Spy tool - click the "Edit Path Weights" link in the right bottom corner of the Spy window... Or via Global Settings dialog... Surprisingly, there is not much information about Path Weights editing in the user guide? But it's relative easy to master.
The basic idea is that all attributes are assigned with the weight value. The higher the weight value is, the higher priority is assigned to the attribute. Default weight values were set by Ranorex team, but you can easily create your own path weight rules, where you can override these values. For example, the Native Window ControlID has default value 108, which is the highest weight value from all Native Window attributes. So If you want to make another attribute a higher priority, follow these steps...
1) create a new rule
2) select the attribute you wish to set higher priority
3) enter the weight value higher than actual ControlID value (e.g. 120)
4) make sure your new rule is enabled
5) confirm changes That's all. If you now use Spy or recorder, WindowText will be used as a primary Native Window attribute.
Another way, instead of increasing the attribute weight, is to decrease the weight value of the attribute you wish to make a lower priority. Steps are the same as above. Hope this helps?
You do not have the required permissions to view the files attached to this post.
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