Debugging in Quick Test Professional 9.2

Debugging in QTP 9.2 plays a vital role in analyzing the script when an issue is faced and to correct a script we debug the script to understand where the error is there in the script. Debugging is the process of identifying the errors in the script. With respect to QTP 9.2 debugging should be used in context of functions.


QTP has a debug tool bar and you can set debug tool bar in QTP by navigating to View – Toolbar – Debug.


Debug tool bar contains 6 features. There are 6 buttons in the tool bar and they are given below

1. Pause
2. Step Into
3. Step Out
4. Step Over
5. Insert/Remove Breakpoints (F9)
6. Clear all Breakpoints (Ctrl+Shift+F9)
7. Enable/Disable all Breakpoints.

What is a Breakpoint ?

A breakpoint pauses test execution at a specified line of code. Ideally we need to insert a breakpoint at a function call.

To set a breakpoint in the script you need to do any of the following

1. Click in the left margin of a step in the test or function library where you want the run to stop.

2. Click a step and then perform any of the mentioned step

a. Click the Insert/Remove Breakpoint button.

b. Choose Debug > Insert/Remove Breakpoint.

The breakpoint symbol is displayed in the left margin of the test or function library.

Step Into

When Step Into is clicked the execution control pauses at the first executable line within the function. After creating a breakpoint you need to use a step into to enter a function. After this you can either select step over or step out to execute the rest of the function.

Step Out

Step Out would execute all the lines within a function at once and the execution halts at the next function call.

Step Over

After we step into the function body Step over would execute one line at a time and pauses. The test would pause even at the end of the function. We can add variables to watch using the Step Over feature.

If a variable is added to watch we can observe the trend of the variable during execution. We need to use step over to do so.

1 comments:

Nina Athena said...

Thank you for sharing this! What you have shared is very helpful and informative. Would love to see more updates from you.

Website Development

Post a Comment

/* Tynt Insight tracker ----------------------------------------------- */