Modifying and watching the values of variables and properties of objects

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

During a run session, you can use the Watch pane, Local Variables pane, or Quick Watch to view the current value of different code expressions, variables, and object properties:

  • The Local Variables pane displays the current values and types of all variables in the main script of the current action, or in a selected function in your test, function library, or user code files.

  • The WatchPane displays the current values and the types of code expressions and objects that you add to the pane.

  • The Quick Watch enables you to view the current value of a selected object in a line in your test or component, evaluate the value of an expression, or add an item to the Watch Pane.

  • You can hover over objects, variables, or expressions in the Editor and see the value of these expressions.

As you continue stepping through the subsequent steps in your test, function library, or user code file, UFT automatically updates the Watch pane and Local Variables pane with the current value for any variable or expression whose value changes. In addition, UFT reevaluates the information displayed in the Watch pane and Local Variables pane as you make changes in the context of your debug session (in the Console Pane).

You can also change the value of a variable or property manually in Watch pane and Local Variables pane. For example, for test objects that support the Object property, you can edit the value of a run-time object property displayed in the Watch pane, thereby changing the value of the property in the application you are testing before you resume the run session.

You can add any of the following types of expressions to the Watch pane or the Quick Watch:

  • The name of a GUI test object

  • The name of a variable

  • The name of a property

  • Any other type of code expression

  • Caution: UFT runs the expressions in the Watch pane to evaluate them. Therefore, do not add a method or any expression whose evaluation could affect the state of the test or any GUI test object, as this can lead to unexpected behavior of your test, component, function library, or user code file.

Expressions added to the Watch pane are saved with the document and updated accordingly as you make changes to your document.

For task details, see Check the values of variables and expressions.