background image
<< Debugger - Evaluating expressions | Debugger - Tips on debugging >>
Debugger - Running, resetting, and terminating execution
<< Debugger - Evaluating expressions | Debugger - Tips on debugging >>
180
User's Guide
7 U
SING
THE
D
EBUGGER
Running, resetting, and terminating execution
Properties and methods for a class are valid in expressions, as long as the
declaration for the class they belong to is included in one of the modules used
by the script being debugged.
If an expression evaluates to a complex value, like an array, SilkTest may
display its result in collapsed form. Use View/Expand Data or View/Collapse
Data (or double-click on the plus icon) to manipulate the display.
Running, resetting, and terminating execution
Procedure To run the script you are debugging, select Debug/Run.
The script runs until a breakpoint is hit, an error occurs, or it terminates.
Procedure To reset a script, use Debug/Reset.
This frees memory, frees all variables, and clears the call stack. The
focus will be at the first line of the script.
Procedure To abort execution of a running script:
·
Press Shift-Shift when running a script on the same machine.
·
Select Debug/Abort when running a script on a different machine.
Procedure To exit the debugger, select Debug/Exit.
Tips on debugging
This section describes some common bugs and how to find them. It also
includes some ideas for designing and testing scripts with error detection in
mind.
Troubleshooting common problems
Typographical errors
It is very easy to make typographical errors that the 4Test compiler cannot
catch. If a line of code does nothing, this might be the problem.
Global variables with
unexpected values
When you write a function that uses global variables, make sure that each
variable has an appropriate value when the function exits. If another function
uses the same variable later, and it has an unexpected value on entry to the
function, an error could occur.