Default Property to use when generating RxPaths

Ranorex Studio, Spy, Recorder, and Driver.
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: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

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: 7470
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
Or via Global Settings dialog...
EditPathWeights_2.png
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
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 Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration