Default Property to use when generating RxPaths

Ranorex Spy, Recorder, and Studio.
slither
Posts: 11
Joined: Thu Jun 18, 2009 3:27 pm

Default Property to use when generating RxPaths

Post by slither » Tue Jul 07, 2009 7:26 pm

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?)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Default Property to use when generating RxPaths

Post by Support Team » Wed Jul 08, 2009 5:43 pm

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
.
Image

slither
Posts: 11
Joined: Thu Jun 18, 2009 3:27 pm

Re: Default Property to use when generating RxPaths

Post by slither » Wed Jul 15, 2009 2:18 pm

Thank you very much. The plugin works like a charm! :)

liap
Posts: 1
Joined: Fri Jan 04, 2013 11:17 pm

Re: Default Property to use when generating RxPaths

Post by liap » Fri Jan 04, 2013 11:55 pm

Is there now a setting to prevent Ranorex from assigning ControlIds?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Default Property to use when generating RxPaths

Post by odklizec » Sat Jan 05, 2013 5:56 pm

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...
EditPathWeights_1.png
EditPathWeights_1.png (20.21 KiB) Viewed 903 times
Or via Global Settings dialog...
EditPathWeights_2.png
EditPathWeights_2.png (56.84 KiB) Viewed 903 times
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
EditPathWeights_3.png
EditPathWeights_3.png (54.71 KiB) Viewed 903 times
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?
Pavel Kudrys
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