Global variable not using parameters

Class library usage, coding and language questions.
saltsman
Posts: 6
Joined: Tue Feb 14, 2012 4:13 pm

Global variable not using parameters

Post by saltsman » Mon Jul 23, 2012 9:31 pm

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...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Global variable not using parameters

Post by Support Team » Tue Jul 24, 2012 11:04 am

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
.
Image

saltsman
Posts: 6
Joined: Tue Feb 14, 2012 4:13 pm

Re: Global variable not using parameters

Post by saltsman » Tue Jul 24, 2012 7:06 pm

Ah, apparently the object reference error has to do with DataContext.Source. >.<