How can I use a the exact same data variable in multiple test scripts?
Question ID: 105233
0
0

How can I use the exact same data variable in multiple test scripts and only set it once? I would like to set my var to specific data and then use that data in several different test scripts. is this possible? I have tried looking at Public variables but still don’t understand. Please help.

Marked as spam
Posted by (Questions: 22, Answers: 6)
Asked on January 30, 2014 4:11 am
49 views
Answers (1)
0
Private answer

You can use a Function Library to set a Global Variable across multi Actions/Test. When you create a variable outside a function it will become a Global variable. The Global variable is set when the Function library is access and will not go away until QTP/UFT is closed.

You could use an external file to load variables during each test but this would require additional code for each Action.

Another option is to use System Environment variable. This leave a setting around after QTP/UFT is shut down and I do not prefer this options.

For more information check out
Document ID: [KM171372][1]
Title: How to declare a global variable for use with all Actions

[1]: http://support.openview.hp.com/selfsolve/document/+KM171372

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on January 30, 2014 4:20 am
EyeOnTesting

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

X
Scroll to Top