Forum Discussion
ArtemS
Alumni
14 years agoHi Joffre,
You got the general idea: project and project suite variables are available to any test within a project or project suite. However the actual value retrieved from a variable would depend on whether it is declared as persistent or temporary. Persistent variables store their values unless they are explicitly re-assigned. Temporary variables reset their values to the default value each test run. See Project and Project Suite Editor - Variables Page.
Let me give an example:
Case A: Suppose, we have a project variable - Project.Variables.NomeServidor, its default value is "SRV-Def", and the variable is Persistent. In one of the tests, we re-assign its value to "SRV-TSBD-9I". Afterwards, the actual value of Project.Variables.NomeServidor in this test and in all the rest of the tests will be recognized as "SRV-TSBD-9I".
Case B: Suppose, we have a project variable - Project.Variables.NomeServidor, its default value is "SRV-Def", and the variable is Temporary. In one of the tests, we re-assign its value to "SRV-TSBD-9I". Afterwards, the actual value of Project.Variables.NomeServidor in this test instance will be recognized as "SRV-TSBD-9I". However, for all the other tests, the value of Project.Variables.NomeServidor will still be recognized as "SRV-Def".
PS. Also, note that project variables are accessed through the Project.Variables.<Variable_name> syntax. The Project.Variables part cannot be omitted.
Regards.
Kaloyan
9 years agoOccasional Contributor
Hi Guys,
I am using project temporary variable Var1 with default value "Default".
I have a project suit with two tests - Test1 and Test2. Test1 is executed first and then next test item is Test2.
In Test1 i set the Var1 to "NewValue". When I ran my test suite and use the value of Var1 in my second test item "Test2" it's still "NewValue".
According to the above post Var1 should be with its default value "Default" since it is a Temporary variable and should not persist during the instances of different test items.
Please correct me if I am wrong.
Kind Regards
ATQC Kaloyan Chipilev