Evaluating Expressions

Applies to TestComplete 15.31, last modified on March 17, 2022

You can evaluate variable values, parameters and code expressions during test debugging. To do this, pause the test at the desired point and then use one of the ways described below.

For JavaScript users: Currently, you cannot modify local variables during debugging.
To pause the test execution

In TestComplete, you can debug script code and keyword tests. The ways you stop them are similar. To pause the test execution, do one of the following:

  • Set a breakpoint on the desired script line or operation of a keyword test. See Using Breakpoints.

  • Set the cursor to the desired line or operation and then run the script or test to the cursor. See Running to the Cursor.

  • Press Pause on the Debug toolbar (if the toolbar is hidden, right-click somewhere in the toolbar area and choose Debug from the ensuing context menu).

    If you are running a keyword test, you can also pause the test execution by right-clicking within the Keyword Test editor and choosing Pause from the context menu.

  • Call the Runner.Pause script method.

    If you call this method within a script routine, TestComplete will pause the execution on the next line after the line holding the method call.

    If you call this method within a keyword test by using the Run Code Snippet or Call Object Method operations, TestComplete will pause the test execution on the next operation.

Once the test execution is paused, you can evaluate expressions.

Evaluating Expressions

Then, to evaluate variables and expressions during the debugging, you use the Watch List panel and the Evaluate dialog. To check values of local script variables and script method parameters, as well as keyword test variables and their parameters, you can also use the Locals panel. For more information on this, see the description of the panels and dialog.

Using the panel and dialog you can also evaluate expressions when debugging script code. However, TestComplete offers some easier means to perform the evaluation in the Code Editor.

The easiest way to evaluate an expression in the Code Editor is to move the mouse cursor over it. For instance, to know the value of a variable, move the mouse cursor over this variable. TestComplete will show the variable value in a popup window. The evaluated expression is highlighted in the Code Editor.

Note: You cannot evaluate complex expressions that include function calls by moving the mouse cursor over them.

See Also

Debugging Tests
Evaluate Dialog
About Watch List Panel

Highlight search results