Home > Running a Script > Running a Script in Debug Mode > Step by Step Execution

Step by Step Execution

Using Step Into way of debugging, execution proceeds one line at a time.

IMPORTANT LIMITS: As you step through the script code, the focus moves between the Editor window and the window of the application under automation. After executing each script line, WinTask debugger deactivates the application window and moves the focus to the Editor window. Before executing the next line, the debugger re-activates the application window. So for example, if the script right clicks a context menu, the activation of the Editor window will close the context menu and next step execution will fail.
USE STEP BY STEP EXECUTION ONLY FOR NON-INTERACTIVE STEPS.


If the line is a call to a Sub/Function, execution jumps to the first line to execute in this Sub/Function and stops there, ready to execute one line at a time again in the Sub/Function.

Step into is the same as a Step by Step execution.

To start the Step by Step execution, press F11 when the Editor window has the focus, or select Debug/Step Into menu, or click the Step Into  icon on the Debug toolbar (select View/Debug toolbar menu to show the Debug toolbar).

When one line is executed, the Editor window is minimized and the focus is back to the application under automation. When the line execution has finished, the Editor window is restored and a green arrow tells which line will be executed next. During execution, the minimized Editor window can disappear from the Windows taskbar and reappears as soon as it can be restored again.

Before pressing again F11 to execute the next line in step by step mode, you can view the contents of variables using the Watch pane.

All the debug mode features are available when the Editor window is restored, so you can insert breakpoints, stop debug mode, step over, etc... You can too modify the code within the script and continue execution with the new code.

Note that if a line contains calls to several WinTask functions, you will need to press F11 several times to execute just one line.

See also

About Debug Mode
Debug Mode in Action on a Sample Script
Step Over
Step Out
Run To Cursor
Breakpoints
Watch Variables
Debug Toolbar