Attribute weights are integer values that Ranorex Studio assigns to UI element attributes. These weights determine which specific attributes Ranorex Studio includes in RanoreXPath expressions to identify UI elements.
What are attribute weights?
Ranorex Studio identifies UI elements by selecting from over 600 attributes. These attributes derive from two categories: role-specific characteristics and technology-specific capabilities.
Each attribute possesses three components:
- Attribute name: For example, ControlName
- Element-specific value: For example, RxButtonExit
- Weight value: An integer between 0 and 200.
When Ranorex Studio generates a RanoreXPath for a UI element, it uses the attribute with the highest weight. Ranorex Studio ignores attributes with weights below 100 for RanoreXPath generation, though it sometimes uses them to generate names for repository items automatically.
In the example above, Ranorex Studio uses ControlName to identify the Exit button in the Ranorex Studio Demo Application because it has the highest attribute weight at 150.
Ranorex Studio includes default attribute weights for all attributes based on industry experience. These defaults work for most scenarios; however, you may need to fine-tune them to identify UI elements with dynamic attributes reliably.
Configure attribute weights
Open the configuration dialog using one of the following methods:
- In Ranorex Studio or Ranorex Spy, click Settings > Advanced > Edit attribute weights…
- In Ranorex Spy under Browser & Results, select an element in the element tree, and under Overview, click Edit path weights…
The configuration dialog opens:
-
Overview of all currently existing attribute weight rules and buttons to add, delete, and disable them.
- Button to restore the default attribute weight values
- Fields to name the rule and to control which attribute’s weight you want to change and whether conditions should apply
- Link to display the attribute weight values for this rule (see image below)
- Fields to create and edit rule conditions