Hi there.
I think this is the scope of variables within a Ranorex Solution...but I just want to be sure.
1. A variable created within a test case's recording module or user code module is local to that module and its value not available to other recording modules/user code created within the same test case.
2. A repository variable can be accessed project wide - through data binding and or by code.
3. In order to allow variables a more "global scope" then must be bound to a Global Parameter declared at the Test Suite Level. Once that is done the initial default value of the Global Parameter can be read or modified by any module level variables that are bound to it.
Please correct if I'm off track here.
Thanks
Brent
Scope of Variables
-
- Certified Professional
- Posts: 23
- Joined: Wed Jun 25, 2014 11:59 am
Re: Scope of Variables
Your analysis seems to be sound. Ranorex relies on .NET scoping since it is built on .NET.
I would add that you can add "public static" variables to any user code area (including Program.cs) and those values can be accessed by any other object at any time during the execution. But, as with any other type of globally scoped entity, since they are public they can be manipulated by anything, possibly in ways that you didn't intend, so use them with caution.
I would add that you can add "public static" variables to any user code area (including Program.cs) and those values can be accessed by any other object at any time during the execution. But, as with any other type of globally scoped entity, since they are public they can be manipulated by anything, possibly in ways that you didn't intend, so use them with caution.
Shortcuts usually aren't...