Debugging Tests and Components

Relevant for: GUI actions, scripted GUI components, function libraries, user code files, and business process tests

After you create testing documents such as a test, component, function library, event handler, or user code file, you should check that it runs smoothly, without errors in syntax or logic. If there are problems, you can stop and debug your tests.

UFT provides different options that you can use to debug your tests in order to detect and isolate defects in a document. For example:

  • You can control the run session and begin debugging by using the Pause command, breakpoints, and various step commands that enable you to step into, over, and out of a specific step.

  • When a run session is suspended, you can use the Debug panes or Quick Watch to check and modify the values of code objects and variables and to manually run script or code commands.

  • If UFT displays a run error message during a run session, you can click the Debug button on the error message to suspend the run and debug the document.

  • You can run a single step or step-by-step in a test, component, function library, or user code file by using the Step Into, Step Out, and Step Over commands:

    Step Into

    Runs only the current step in the active document.

    When debugging a GUI test, if the current step calls another action or a function, the called action or function is displayed in the document pane. The test or function library pauses at the first line of the called action or function.

    Step Out Continues the run to the end of the function, or user code file, returns to the calling test, component, or function library, and then pauses the run session at the next line (if one exists).
    Step Over

    If the current step calls a user-defined function, the called function is executed in its entirety, but the called function script is not displayed in the document pane. The run session then returns to the calling document and pauses at the next step (if one exists).

    If the current step calls another action, the called action is displayed in the document pane, and the run session pauses at the first line of the called action (like Step Into).

  • Run to or from a specific step or action.