Project variable to be used across different tests
I am having a Desktop application where one test captures certain dynamically generated ID and it needs to be passed as an input to another test.
Ex: Var1 is captured in Test1 - Unit1 script, through function InvID()
Now, I need to pass this Var1 as an input to one of the field in Test2.
Questions :
1. How do I declare the variable Var1 as global or Project variable
2. How do I call this variable, Var1, in the keyword driven testing, to pass it as an input to the new field in Test2
Thanks in Advance.
You need to create the variable at the project or project suite level if you're using keyword tests
If you're scripting you can add project or project suite variables in the script itself:
Project.Variables.AddVariable("MyNewVariable", "String");
Refer to the documentation for more information:
Project/Project Suite Variables in keyword tests
Project/Project Suite Variables in scripts
Actually using them is much the same as in your original question in the other thread.