Run Time Debugging Through Print Utility Statement in QTP

I believe you have used “msgbox” function almost every time for debugging purposes i.e. displaying some text at run time. But the problem with “msgbox” function is that it keeps open till you close it and moreover you can’t debug further, since it’s a modal dialog box. You have to press OK button to move ahead.

How about a similar utility function, which works very similar, like “msgbox” and also provides the user the flexibility to perform further debugging?

Yes, it is possible. HP Quicktest Professional (QTP) provides a Print utility statement which is used to display information in the “QuickTest Print Log” window while still continuing your Run Session.

Looks pretty interesting!!!!!!! Alright, then go ahead and read more.

Firstly let us see what happens in case of “msgbox” function. As soon as the script encounters the “msgbox” function, it displays a dialog box and the script gets paused till the user presses the OK button.

Here you need to press the OK button in order to continue.

In order to counter this problem, HP QTP also provides a fantastic Print utility which is very similar to its “msgbox” counterpart but much more flexible. It can be used for debugging purposes. It is very simple to use inside QTP tool.

As you can see from this screenshot, QuickTest Print Log window remains open even after your script has finished running, thus providing more flexibility.

So from now on which one you would like to use? QTP’s “msgbox” function or QTP’s Print Utility Statement?

Did you like my explanation of the concept in the above article?

Being Technology Savvy, I am sure you must be curious to read many more interesting articles on QTP; How about subscribing to my Feed? This will help you in automatically knowing the moment I post an article on my Site.

So let us join and let us Learn & Master the great Tool QTP.



Source by Piyush Gupta

Popular Posts

Leave a Reply