Page 1 of 1
Global variable not using parameters
Posted: Mon Jul 23, 2012 9:31 pm
by saltsman
Code: Select all
public static class GlobalVars
{
static AdjacencyGraph<Dir.LdapEntry, Edge<Dir.LdapEntry>> _gr;
public static AdjacencyGraph<Dir.LdapEntry, Edge<Dir.LdapEntry>> gr {
get{
return _gr;
}
set{
_gr = value;
}
}
}
I want to access gr in all of my tests so I can pull out users based on LINQ filters like w.getAttribute("employeeType").StringValue == "Teacher" or "Student" and whatnot. Is there I place I can define this somewhere? Program.cs doesn't seem to do it, nor does putting it in it's own file...
Re: Global variable not using parameters
Posted: Tue Jul 24, 2012 11:04 am
by Support Team
Hi,
Put your global variables in a new static class of your project (right-click on your project - add - new item - class). So you have access to these variables in all of your recordings / codemodules in your project.
Regards,
Larissa
Ranorex Support Team
Re: Global variable not using parameters
Posted: Tue Jul 24, 2012 7:06 pm
by saltsman
Ah, apparently the object reference error has to do with DataContext.Source. >.<