Balance Speed & Robustness with the Slider
To ensure your automated tests in Ranorex are both reliable and maintainable, it’s essential to craft robust RanoreXPaths
- Navigate to Settings > Advanced to find the Speed/Robustness slider, which balances execution speed versus resilience to UI changes.
- The recommended range is 30%- 50%, offering an optimal balance of reliability and performance.
Avoid Dynamic and Random Automation IDs
Another common pitfall to watch out for is the use of dynamic or random-looking Automation IDs.These values are often auto-generated and may change between runs, resulting in unexpected test failures.
- Automation IDs that look like random numbers, for example, element[@automationid='6843137'], can break tests when those IDs change.
- Instead of relying on unstable attributes, like dynamically generated IDs, use more persistent properties such as class, innertext, or developer-defined static IDs.
Use and Customize Path Weight Rules
- To prioritize stable attributes over dynamic ones, adjust the Attribute Weight Rules in Ranorex Studio.
- For instance, if ControlName is unstable, reduce its weight and increase that of ControlTypeName, or vice versa, depending on your context.
Avoid Relying on Indexes in Paths
- Index values after an element div[4] because it changes periodically.
- Moving the Speed/Robustness slider toward more robust settings can help Ranorex avoid using indexes in generated paths