Iam using rest sharp in ranorex Hi I have created a folder called data providers and I have inserted module variables like this
string _fname = "";
[TestVariable(""afaf**********)]
public string fname
{
get { return _fname; }
set { _fname = value; }
}
I tried to access fname from different class like objectname.fname and it returns null.
CAn you please tell me how to get the value which is binded to fname from a different class?
One solution that I have used and that works is to create a global variable and bind it to the module variable and then in the testcase/module that you need that value, use the global variable which now is assigned with the value of the module variable.
You can do it like this
Create global variable in the test suite- var_global
Create module variable in module 1- fname
In module 1, assign the module variable to global variable -
TestSuite.Current.Parameters["var_global"] = fname
Create a module variable in module 2 = var_mod2
Use the global variable
var_mod2 = TestSuite.Current.Parameters["var_global"]