Applies to TestComplete 14.70, last modified on October 20, 2020

For each breakpoint you can specify an expression that will be evaluated each time the breakpoint occurs during the test run. You can specify this expression in the Condition column of the Breakpoints panel or in the Condition edit box of the Breakpoint Properties dialog. If the expression becomes True (greater than zero), the breakpoint will pause the test. If the condition becomes False (or zero), the debugger will not stop at the breakpoint location.

Conditional breakpoints are useful when you want to see how your test behaves when a variable gets into a certain range or when a definite flag is set.

For instance, you want a breakpoint to pause on a test operation only when the variable Count is greater than 3. In this case:

  • Set the breakpoint on the desired keyword test operation or script line.

  • Press on the Debug toolbar to call the Breakpoints panel.

  • In the Breakpoints panel, select the breakpoint you have just created.

  • If Count is a keyword test variable, enter KeywordTests.KeywordTest_Name.Variables.Count > 3 into the Condition column. Here, KeywordTest_Name corresponds to the name of your keyword test, for instance, KeywordTest1.

    If Count is a script variable, enter Count > 3 into the Condition column.

  • Press Enter to save changes.

Note: You can specify any valid script language expression in the Condition column, but all symbols of the expression (all the variables, objects, properties and methods) must be accessible from the breakpoint’s location.

You can also specify a condition for existing breakpoints. To do this, either modify the Condition column for the desired breakpoint in the Breakpoints panel, or call the Breakpoint Properties dialog for the desired breakpoint and specify the condition in this dialog. To call the dialog, right-click on the breakpoint mark in the Code Editor or in the Keyword Test editor and choose Properties from the subsequent context menu.

After you specified a conditional expression for a breakpoint, TestComplete changes the breakpoint icon from to (or from to ). This indicates that the breakpoint is a conditional breakpoint.

See Also

Conditional Breakpoints
Using Breakpoints
About Breakpoints Panel
Breakpoint Properties Dialog

Highlight search results