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.
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:
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
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”
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”
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
…
var1=value1
var2=value2
…
No comments:
Post a Comment