Relevant for: GUI actions, scripted GUI components, function libraries, user code files, and business process tests
This task describes different ways you can control and debug your run sessions so you can identify and handle problems in your documents.
You must have the Microsoft Script Debugger installed to run tests or components in debug mode. If it is not installed, you can use the UFT Additional Installation Requirements Utility to install it. (Select Start > All Programs > HPE Software > HPE Unified Functional Testing > Tools > Additional Installation Requirements or <UFT installation folder>\bin\UFTInstallReqs.exe.)
To debug API tests, you must enable the debugger. Select Tools > Options > API Testing tab > General node and select Run test in debugging mode.
During a run session, UFT normally runs steps quickly. To slow the test run speed to enable more effective debugging, in the Test Runs pane of the Options dialog box (Tools > Options > GUI Testing tab > Test Runs node), specify the time (in milliseconds) UFT pauses between each step by modifying the Delay each step execution by option.
|Step Into||In the toolbar, press the Step Into button .|
|Step Out||In the toolbar, press the Step Out button .|
|Step Over||In the toolbar, press the Step Over button .|
Select the step in your document at which you want UFT to stop and select Run > Run to Step.
Select the step at which you want UFT to start the run and select Run > Debug from Step.
Note: These commands can also be used to stop at a specific action. Right-click an action in the canvas and select Run to Action, Debug from Step, or Run from Action.
For details, see Use breakpoints .
- If you a run a test using the Run automation method, the test does not stop at breakpoints even if they are saved in the test.
- If you run a test with breakpoints using the Run automation method, the breakpoints remain visible but are ignored during the test run.
- If you are running a test from the ALM Test Lab module in hidden mode (as specified in the UFT Remote Agent, UFT will not stop the test at the breakpoints.
- If you are running a test from the ALM Test Plan module not in hidden mode, the test stops at breakpoints if you select the Run Test Sets in debug mode option in the UFT Remote Agent
For details on Remote Agent settings, see Remote Agent Settings Dialog Box.
|In the Watch Pane||
The Watch pane displays the value of selected variables and expressions that have been added to the Watch Pane.
To add an expression do one of the following:
To add an to the Watch pane, you must use an expression that calls GetROProperty. This enables you to watch the run-time value of the object's . For example, to watch the value currently displayed in the Calculator application, you can add the expression:
You can add an expression to the Watch pane from the Editor or from a function library, but not from the Keyword View.
|In the Quick Watch||
|In the Local Variables pane||UFT displays all variables in the test or component (up to the current step) and their value in the current context of the test or component run.|
|In the Editor||
Hover over an object, variable, or expression when the test run is paused. UFT displays a floating tooltip with the value:
Note: To expand the ability of UFT to display information on test objects, we recommend registering PDM from Internet Explorer (for versions of Internet Explorer 8 or higher and Visual Studio 2008). Enter the following in the command line to register the .dll: regsvr32 "%ProgramFiles%\Internet Explorer\pdm.dll"
Do one of the following:
In the Console pane, enter a command to change the value of an object, variable, or expression.
In the Watch or Local Variables pane, in the Value column for the object, variable, or expression, manually change the value.
In the Console pane, enter the command to run.
To view the currently running call stacks in your run session, select View > Debug > Call Stack. You can double-click on a stack name in the pane to navigate directly to the line of code that begins the call stack.
Select View > Debug > Threads. In the list of threads that is displayed, you can double-click on the thread name to navigate directly to the beginning of the thread.
Select View > Debug > Loaded Modules. UFT displays the list of currently loaded modules (depending where in the test you have paused).