Hello,
I'm looking for where to store references to some .NET runtime objects which get initialized in the first module of the test suite, and are shared across all modules, up until the end of the test.
The main repository seems to be a proper place to store global variables like that. But repository vars seem to be limited to strings only, while I need to keep live objects in there. I'd hate creating a static member of the Program class. There should be a better way to share the state between modules.
I apologize if that's been answered before, could not find it.
Thanks,
Andrew.
Global state objects
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Global state objects
Hi,
Regards,
Peter
Ranorex Team
If you want to use global state objects you should implement a singleton. Therefore please take a look to following link http://msdn.microsoft.com/en-us/library/ff650316.aspxandrewn wrote:The main repository seems to be a proper place to store global variables like that. But repository vars seem to be limited to strings only, while I need to keep live objects in there. I'd hate creating a static member of the Program class. There should be a better way to share the state between modules.
Regards,
Peter
Ranorex Team
Re: Global state objects
Thanks for replying, Peter. Singletons are effectively global static variables, like FusionRepository.Instance, but I can live with that.Support Team wrote:Hi,
If you want to use global state objects you should implement a singleton. Therefore please take a look to following link http://msdn.microsoft.com/en-us/library/ff650316.aspx