How to access variables from a different modules?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
QATest879
Posts: 31
Joined: Fri Jul 02, 2021 2:35 pm

How to access variables from a different modules?

Post by QATest879 » Thu Dec 02, 2021 8:20 pm

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.

QATest879
Posts: 31
Joined: Fri Jul 02, 2021 2:35 pm

Re: How to access variables from a different modules?

Post by QATest879 » Thu Dec 02, 2021 8:37 pm

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.