Run and debug recordings
In this chapter, you’ll learn how to run and debug recordings.
For now, we’ll focus on running a test recording in its simplest form: executing recorded actions one after another. In the larger context of test automation, running a test means executing iterations based on different sets of user data, parameters, and test scenarios. We’ll deal with this in later chapters.
Screencast
The screencast “Run and Debug a Test” walks you through the information found in this chapter.
In this chapter
Screencast
To see how to run a single recording, run a test case or test suite, execute individual steps in a recording, and enable Turbo mode or Debug mode, watch our video ⇢ Ranorex Studio Recorder basics 4: Run and debug a test
Enable turbo mode
By default, Ranorex Studio uses a predefined delay between actions to control how fast they’re replayed. You can enable Turbo mode to speed up replaying by reducing this delay to almost zero.
In the recording module toolbar, click Turbo mode to turn turbo mode on or off.
Turbo mode button in Ranorex Recorder
Note
- Turbo mode is applied to all actions in the active recording module.
Run a recording module
This section demonstrates how to run a single recording module.
In the Recorder view, click RUN.
Watch as the run starts and progresses.
When the run finishes, the test report appears.
Hint
Remember: Don’t touch your mouse or keyboard during the test run, or you might cause a test failure.
Running a recording module
Further reading
Test reports, their structure, content, and interpretation are described in Ranorex Studio fundamentals > Reporting > ⇢ Introduction.
Run the test suite
Running individual recording modules is usually only done when editing or troubleshooting them. Normally, tests are run based on a test suite that contains test cases. This is usually done from the test suite view. The test suite view is the central point of control for modularization and test case management.
Further reading
The test suite and its uses are explained in greater detail in Ranorex Studio fundamentals > Test suite > ⇢ Introduction.
Switch to the test suite view
There are two ways to switch to the test suite view.
In the Studio toolbar, click the View test suite button.
Alternatively, click the tab Introduction.rxtst (rxtst = Ranorex test suite file).
Switching to test suite view
Hints
- The example test suite has the same name as the test project:
Introduction
. - The current test suite contains one test case with the default name
TestCase
. - The test case contains a setup and a teardown region.
- The test case contains a recording module with the default name
Recording1
. - The ticked checkbox means the test case will be executed during the test run.
Execute the test case
In the test suite view, click RUN. This runs the entire test suite. In our example, the test suite contains one test case, so only this test case executes.
Watch as the run starts and progresses.
Running a test case
When the run finishes, the test report appears.
Test report showing a successful run
Further reading
Reports, their structure, content, and interpretation are explained in greater detail in Ranorex Studio fundamentals > Reporting > ⇢ Introduction.
Screencast
The screencast “Progress dialog” introduces you to the real-time information that the progress dialog offers:
Pause/resume a test run
You can pause a test run while it is executing and resume it later. This is useful e.g. if you notice your test environment is not set up correctly and want to correct this so your test doesn’t fail for a reason that has nothing to do with the application itself.
Note
- If you have activated video reporting, pausing a test run does not pause video recording.
- If you pause a test run and make changes to the test in Ranorex Studio, these changes will not affect the test run.
- If you pause a test run and make changes to the application/system under test, these will of course affect the test run after resuming.
To pause or resume a test run:
While a test is running/paused, press End.
Label in the progress dialog indicating the test run is paused.
Info section showing the test run hotkeys. End pauses/resumes.
Global run buttons
You don’t have to be in the test suite view to run or stop a test suite. You can also click the global run and stop buttons in the Studio toolbar. They are always visible, regardless of your current view.
Global run and stop buttons in the Studio toolbar
Run options
Sometimes, you don’t want to run an entire recording, or you might want to control the run similar to debugging a computer program, as described below.
Change to the Recorder view.
Right-click an action and select one of the options explained below.
Context menu on action #4
Run selected item(s)
Runs only the selected action(s).
Run to here (excl. selection)
Runs the recording starting at action #1 and up to, but
Run from here
Runs the recording starting at the selected action.
Record from here (after selection)
Starts a recording and adds the recorded actions between the selected action and the next.
Debug – enable/disable Continue on fail
When an action causes an exception during a test, the default behavior is that the test aborts. Sometimes, you might want the run to continue instead. This is where the option Continue
Further reading
The debugging option Continue on fail is part of the concept of actions and is explained in detail in Ranorex Studio fundamentals > Actions > ⇢ Managing actions.
Debug – insert a log message
When tests become complex, it’s often helpful to add special log messages to the report.
Further reading
Log messages and other options for controlling the test report are described in detail in Ranorex Studio fundamentals > Reporting > ⇢ Basic report characteristics & data.
Enable/disable debug mode
Ranorex Studio includes a dedicated debug mode that works by setting breakpoints in programming code. This is an expert topic, which is why we only touch on it here briefly.
Ranorex Studio debug mode
Turning debug mode on/off
Debug mode requires Ranorex Studio to be run as an administrator. If this isn’t the case, a prompt to restart in administrator mode appears.
Hint
Debug mode decreases Ranorex Studio performance by around 30%.
Further reading
Debugging is an expert topic and is explained in Ranorex Studio expert > Ranorex Studio IDE > ⇢ Debugging.
Download the sample solution
Download our sample solution to try the steps and options explained in this chapter yourself.
Sample solution
Theme: Run and debug recordings
Time: Less than 10min
Installation:
Unzip to any folder on your computer.
Start Ranorex Studio and open the solution Introduction.rxsln
Hint
The sample solution is available for Ranorex Studio versions 8.0 or higher. You must accept the automatic solution upgrade for versions 8.2 and higher.