How can I use a global variable across multiple tests and functions?

Posted 9 days ago by Akshay

Post a topic
Answered
A
Akshay


I have defined a global variable in a test, let's call it Test1. Since it's a global variable, it should be accessible across different tests. However, I'm unable to see this variable in the context variables section of other tests. Can anyone explain how I can use this global variable in other tests and functions within the suite?

0 Votes

T

TheBugScout posted 9 days ago Best Answer

The global variable you created or defined in one test ( let's say Test1 ) will be visible in the context variable section of that specific test, but not in the context variable section of other tests. However, since it is a global variable, you can still use it in other tests and functions.


Here is a workaround to use the global variable in another test:


1. Copy the global variable from the context variable section of the test where it is defined using the copy icon in front of the name of that global variable.


2. Go to the other test or function where you want to use it and paste it into the required step where you want to use it.


0 Votes


1 Comments

T

TheBugScout posted 9 days ago Answer

The global variable you created or defined in one test ( let's say Test1 ) will be visible in the context variable section of that specific test, but not in the context variable section of other tests. However, since it is a global variable, you can still use it in other tests and functions.


Here is a workaround to use the global variable in another test:


1. Copy the global variable from the context variable section of the test where it is defined using the copy icon in front of the name of that global variable.


2. Go to the other test or function where you want to use it and paste it into the required step where you want to use it.


0 Votes

Login or Sign up to post a comment

© Orasi Software, Inc. | All Rights Reserved.