You can use the Run from Step option to run a selected part of your test. This enables you to check a specific section of your application or to confirm that a certain part of your test runs smoothly.
In the Expert View, you can use the Run from Step option to run your test from the selected step until the end of the action. Using Run from Step in this mode ignores any iterations. However, if the action contains nested actions, QTP runs the nested actions for the defined number of iterations of the nested action.
In the Keyword View, you can use the Run from Step option to run your test from the selected step until the end of the test (if the selected step is not part of a reusable action, because a reusable action needs to be called from a test, in order for the test to know from where to continue). Using Run from Step in this mode includes all iterations. The first iteration will run from the step you selected until the end of the test; all other iterations will run from the beginning of the test.
You can use the Run Current Action option to run a single action in your test. Using Run Current Action ignores any iterations. However, if the action contains nested actions, QTP runs the nested actions for the defined number of iterations.
Please note, if you only want to run one iteration of your test, select Run one iteration only from the Run pane in the Test Settings dialog box.
If you want to run your test until a specific point within the test (and not to the end of the action or test), you can insert a breakpoint. The test will then run from the selected step or action until the breakpoint.
To run an entire action, or run a test or action from a selected step:
- Make sure your application is in a state matching the action or step you want to run.
- Select the action or step where you want to start running the test. Make sure that the step or action you choose is not dependent on previous steps, such as a retrieved value or a parameter defined in a previous step.
- Select Automation > Run from Step or Run Current Action, or right-click and select Run from Step. The Run dialog box opens.
- In the Run dialog box, choose where to save the run session results, and define any input parameters you want to use.
- Click OK. The Run dialog box closes and the run session starts
If you cleared the View results when run session ends check box in the Run pane of the Options dialog box, the Test Results window does not open at the end of the run session.