SOFTWARE TESTING: How to specify the environment variables to be loaded when QTP is started

Tuesday, October 11, 2011

How to specify the environment variables to be loaded when QTP is started

How to specify the environment variables to be loaded when QTP is started

You can either define individual values in the .vbs file or specify an environment file to load.
Example:
Here is what the .vbs file could look like:
Dim App ‘As Application
‘ Launch QTP
Set App = CreateObject(“QuickTest.Application”)
App.Launch
App.Visible = True
‘ Load an INI file with user-defined parameters
App.Test.Environment.LoadFromFile “C:\Test_Params\environment_file1.ini”
‘ Set the value of a specific user-defined Environment variable
App.Test.Environment.Value(“newvariable”) = “new value”
As you can see from the example, the Environment variable file is actually an .ini file. The structure would be:
   [Environment]
   var1=value1
   var2=value2
   …
There are several other options and settings you can set using the Automation Object Model. You can find documentation on this feature in the Documentation section on the Customer Support website. You do need to use QuickTest Professional 6.5 in order to use the Automation Object Model.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...