QA Focus

Jul 11 2008   8:20PM GMT

HP QuickTest Professional Tips ‘n’ Tricks – July 2008

Sentinel627 Greg Annen Profile: Sentinel627


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:


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


1  Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • Karne2u
    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.
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: