You can play back scripts to execute one line at a time while in debug mode. Known as
stepping, this allows a tester to trace through code during playback to see the order in which statements execute, which aids in debugging.
Stepping enables you to walk through a script in debug mode to closely examine its execution.
In debug mode, control playback execution by using the following commands:
- Step Into (F8)
- Executes the script one statement at a time.
Step Into is useful to trace through each line in the code and steps into functions or embedded scripts. Each function or embedded
script is also executed one code line at a time.
Step Into is useful for detailed analysis of a test, and lets you see the effect of each statement on variable usage and test application
interaction.
Note: You cannot step into an
iterator while debugging a VB .NET script. The iterator is executed but the debugger will not show that the iterator was entered during
execution. You can set a breakpoint inside the iterator, and the execution will stop at the breakpoint, but any parameters
or local variables of the iterator will not be shown in the
Locals window. For additional information on iterators, see
Iterators.
- Step Over (Shift + F8)
- Executes each procedure as if it were a single statement. Use this instead of Step Into to go directly into a function, without
stepping through the individual lines that make up the function.
- Step Out (Ctrl + Shift + F8)
- Executes all remaining code in a procedure as if it were a single statement, and exits to the next statement in the procedure
that caused the procedure to be initially called.
- Run To Cursor (Ctrl + F8)
- Allows you to select a step where you want playback suspended. This allows you to "step over" selected sections of a visual
test or script.
Use
Run To Cursor to playback the visual test or script and stop playback at a point just before a run-time error occurs. This lets you stop
playback at a specific line or statement without having to insert breakpoints. Once playback stops, you can continue using
one of the other debug options.
- Set Run Pointer/Next Statement
(Ctrl + F9)
- Continues execution with the statement at which the pointer is currently located, without executing any intermediate statements.
Stepping commands are accessed from the
Debug menu.