How2 Pass a single Argument to Muliple Tests using only UFT
Question ID: 105569
0
0

In multiple UFT tests I have been declaring a variable "system" and assigning it a value system = "host1" , then later in the test script performing various Select Case system Case "host1" to do different things based on the value. Then I use Test Batch Runner to execute these tests (about 70+) and want to pass a single argument "system" to each of the tests, without having to edit my scripts every where I set the value – but dont know how to do this.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on August 19, 2014 6:04 pm
50 views
Answers (5)
2
Private answer

One method is to use a global variable (MyVar, for example) in a .vbs file.

Create global variable to hold the test value in a .vbs file.
example:
Dim MyVar
Set MyVar=''ABC.XYZ''

See HP document KM196956 or KM171372 for more details.

Document ID: KM196956
Title: How to pass a test object as a parameter to other Actions

Document ID: KM171372
Title: How to declare a global variable for use with all Actions

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on August 20, 2014 9:46 pm
2
Private answer

You could store information in the data sheet (xls) and import the data table on start of test.

See HP document KM171760 for more details

Document ID: KM171760
Title: Can data be imported into an Action data table

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on August 20, 2014 9:47 pm
2
Private answer

Use the ''Environment'' object. This pulls from the machines environment variables.

Example:
' Action1
Environment(''myvar'')= ''VBScript Is Fun!''
' Action2
MyArray = Environment(''myvar'')

See HP Document KM171372 for more details

Document ID: KM171372
Title: How to declare a global variable for use with all Actions

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on August 20, 2014 9:54 pm
2
Private answer

Use a Dictionary object. The Dictionary object can be used as an alternative to using environment variables when sharing values between Actions. The Dictionary object allows the user to assign values to variables that are accessible from all Actions (local and external) in the test in which the Dictionary object is created.

Document ID: KM196956
Title: How to pass a test object as a parameter to other Actions

Document ID: KM184837
Title: How to use the Dictionary object

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on August 20, 2014 9:57 pm
2
Private answer

Last you could use Action and Test parameters.

Document ID: KM196956
Title: How to pass a test object as a parameter to other Actions

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on August 20, 2014 9:58 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top