Page 1 of 1

How to access variables from a different modules?

Posted: Thu Dec 02, 2021 8:20 pm
by QATest879
If I do:

string variablename = "test.";

in one module, for example, "modulename.usercode.cs"

How could I call this variable in another module? I've tried doing modulename.variablename but that doesn't seem to work. And also I've tried doing TestSuite.Current.Parameters["parametername"] but it gives me the error: The given key was not present in the dictionary.

I'm pretty sure that I did the right parameter name though... Any advice, is there any other way to access a variable from another module? Thank you.

Re: How to access variables from a different modules?

Posted: Thu Dec 02, 2021 8:37 pm
by QATest879
I figured it out, I was assuming that the parameter would be found since I was using it under databinding, but to make it work I had to add the parameter in code using this first: TestSuite.Current.Parameters.Add("parametername",value) and after that it works now. The issue is resolved. Thanks.