background image
<< Debugger - Viewing the call stack | Debugger - Running, resetting, and terminating execution >>
Debugger - Evaluating expressions
<< Debugger - Viewing the call stack | Debugger - Running, resetting, and terminating execution >>
User's Guide
179
7 U
SING
THE
D
EBUGGER
Evaluating expressions
If a variable is uninitialized, SilkTest labels it "<unset>." If a variable has a
complex value, like an array, SilkTest might need to display its result in
collapsed form. Use View/Expand Data and View/Collapse Data (or double-
click on the plus icon) to manipulate the display (this was done in the
preceding figure, which shows a record).
Tip To return to the script being debugged, press F6 or select View/
Module and select the script from the displayed list.
Setting variables
While viewing variables, you can also change their values to test various
scenarios.
Procedure To change the value of an active variable, select the variable and
type its new value in the Set Value field.
When you resume execution, the new values will be used.
Viewing a list of modules
Procedure To see a list of modules used by the script being debugged:
1
Select View/Module.
The View Module dialog displays a list of modules. The list includes all
the modules SilkTest loads at startup (that is, the modules loaded by
startup.inc, including winclass.inc), so you can set breakpoints in GUI
functions, window class declarations, and so forth.
2
Double-click on a module's name to view it in a debug window.
Evaluating expressions
When a script reaches a breakpoint, you can evaluate expressions.
Procedure To evaluate expressions:
1
Select View/Expression.
The Expression window is displayed.
2
Type an expression into the input area and press Enter to view the result.
Specifying
expressions
If you type an identifier name, the result is the value that variable currently
has in the running script. If you type a function name, the result is the value
the function returns. Any function you specify must return a value, and must
be in scope at the current line.