Passing objects from test case to test case

Best practices, code snippets for common functionality, examples, and guidelines.
robert.altman
Posts: 8
Joined: Thu Feb 23, 2017 10:54 pm

Re: Passing objects from test case to test case

Post by robert.altman » Mon Mar 06, 2017 3:18 pm

Ok, so here's the solution, based on this thread and Ranorex support (thanks guys).

I have a class where I declare static variables with a get method. Apparently that's all it took. I was under the impression this couldn't be done, and so I never even gave it a shot. Talk about time wasted.
Anyway, here is an example:

Code: Select all

		static Element _varElement = null;
		public static Element varElement
		{
			get
			{
				if(_varElement = null)
					_varElement = repo.SomeElement;
				return _varElement;
			}
		}