Maintenance mode allows you to catch and resolve certain errors during test execution. You can then apply the fixes to your test suite from the report. This saves time because you don’t have to let the entire test run through to start diagnosing and fixing errors.
In this chapter
Activating maintenance mode
Make sure Debug is enabled under Build > Set configuration. The option is usually enabled by default. It is not the same as the debug mode you enable from the menu bar.
Tests cannot be run in maintenance mode on a Ranorex Agent.
Catching and resolving errors
When maintenance mode is active, it catches Ranorex-native errors and pauses test execution upon doing so. Depending on the error type, different dialogs with different options will appear.
Some options are always available:
|Open report||Opens the report.|
|Continue with error||
Continues test execution according to the ⇢ error behavior set for the test container.
|Abort test run||Aborts the test run.|
Element not found
This dialog is displayed when a repository element couldn’t be found. It displays the related error message and the RanoreXPath of the element.
Click Edit and retry to open Ranorex Spy. You can then retrack the element or change its path manually. Once you apply the changes in Spy, Ranorex Studio will automatically try to run the failed action again with the updated path.
You can also click Retry to try again without changing anything. This is useful if you think the path is correct and the element couldn’t be found because the search timeout was too short or the SUT hadn’t reached the correct state yet.
This dialog is displayed when a value couldn’t be validated. It displays the validation error message with the expected and actual values.
The drop-down menu contains the expected value (first option) and the actual value (second option). Select the actual value and then click Apply and retry to run the failed action again with this value.
Image validations cannot be resolved in maintenance mode. The generic dialog will be displayed for them.
This dialog appears for all Ranorex-native errors that are currently not resolvable in maintenance mode. Click Open Spy to inspect the affected element in Ranorex Spy. This can help you diagnose why the error occurred.
Applying your fixes
Once you’ve resolved the errors that appeared in maintenance mode and your test has executed successfully, you can apply the fixes to your test suite in the report.
In the report, maintenance mode events are indicated by a special icon:
Expand the report item to receive more information. Find the maintenance mode event with the green check mark and hover over it to apply the fix to the test suite:
Fixes for variables and data bindings cannot be applied automatically. You will need to manually fix these. This applies to both validation values and RanoreXPaths.