QA Focus

Jul 11 2008   8:20PM GMT

HP QuickTest Professional Tips ‘n’ Tricks – July 2008



Posted by: Sentinel627
Functional testing, HP Quality Center, HP QuickTest Professional, Software Quality

Periodically, I hope to post a few helpful suggestions about using HP’s QuickTest Professional automated test tool. These are the tricky little things that are obvious once you stumble across then actually use them. Perhaps someone else will benefit by my stumbling.

Environment.Value and XML Files

If you load a user-defined environment file (XML) as a Test Resource setting, you can NOT change any of the values (i.e., QTP won’t let you). However, if you define an Environment.Value programmatically, you CAN change its value. This is especially useful for updating global variable values used by functions.

To detect an existing Environment.Value and load if NOT found:

Environment values

Dynamically Loaded Function Libraries

You can use the vbscript ‘Execute’ statement to dynamically load functions as test resources. Put all common functions and subprocedures in a text file, e.g., “global.txt”. Then at the top of the script to be executed, paste in these lines:

Dynamic loaded libraries

Print Run-time Values during Debug

Use the ‘Print’ utility to display information in the QTP Print Log window while still continuing your run session. For example:

ConfigSoapBlock = FaWebServiceGetConfigBlock(“Global”,NameSpace)
Print ConfigSoapBlock

…will display:

Print

These tips apply to all 9.x versions of HP QuickTest Professional

HP QTP

Comment on this Post

Leave a comment:

Karne2u  |   May 11, 2009  12:49 PM (GMT)

Hi Greg,

Your tips were great, have a question on the Print utility…
was wondering if there is any way to save the print log to a file.