QTP - Debugging

Advertisements


Debugging:

Debugging, in automation testing context, is a systematic process of spotting and fixing the coding issues in the automation scripts so that the script will be more robust and can spot the defects in the application.

There are various ways to perform debugging using break points in QTP. Break Points can be inserted just by pressing "F9" or by using the Menu option "Run" -> "Inserting/Removing Break Point".

After Inserting the Break point the "Red Coloured" Dot and the line will be highlighted in RED as shown below:

Debugging using Break Point
MethodShortCutDescription
Step IntoF11Used to execute each and every Step. Steps into the Function/Action and executes line by line. It pauses on each line after execution.
Step OverF10Used to Step over the Function. Step Over runs only the current step in the active document.
Step OutShift+F11After Step Into the function, you can use the Step Out command. Step Out continues the run to the end of the function and then pauses the run session at the next line.

Options in Break Point:

Various Options in Break Point can be accessed by Navigating 'Run' Menu.

ShortCutDescription
F9Insert/Remove BreakPoint
Ctrl+F9Enable/Disable BreakPoint
Ctrl+Shift+F9Clear All BreakPoint
Use Only MenuEnable/Disable All BreakPoints

Debugging Pane:

The Following are the panes in the debugging window:

Debugging using Break Point
  • Output - This Tab displays all the Output of the Print Statements.

  • Watch - This Tab displays the Boolean output of the Given Expression.

  • LocalVariables - This Tab displays the Output of the Local Variables.

Example:

The Watch Pane shows the output expression as shown below:

Debugging using Break Point

The Local Variables Pane shows the values held by the local variables as shown below:

Debugging using Break Point

Advertisements
Advertisements