Hello,
I believe similar questions have been asked before, but I could not find the specific answer I need.
I have created some Recording modules which I reuse in multiple Test Cases. Some of these Recordings have variables that can be bound. So far I have been binding them to either Global Parameters or Simple Data Sources within each Test Case. All of these are predefined constants.
Now this works very well and is pretty clean, but the problem lies here:
I will be testing my application on different computers, and hence different computer names. Which I will need to pass dynamically into these Recording modules.
So I was thinking of creating a Global Parameter called 'CompName' assign its value 'TBD', bind this Parameter to whatever variables I need, and then have some code somewhere set CompName to the appropriate string depending on the actual computer name...
I have not figured out a way of doing this. Where would I put the code and how would I modify the Global Parameter? Is there a better way?
Thank you for your help.
Global Variables
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Global Variables
Hello,
you can write your "code" (described in your post) in a CodeModule. This Code Module can be used like an RecorderModule wherever you want.
To insert a Module Variable in a code module, do a click with the right mouse button in the code and select Insert Module Variable.
The variable could be bound like variables within RecorderModules.
To do e.g. some initialization, execute the CodeModule with the initialization code before starting your SUT (System under Test).
Information about working with code are available here.
If you want to set variables to different values depending on the computer you start it on, you can use command line arguments as described in this topic of the Ranorex User Guide.
Regards,
Martin
Ranorex Support Team
you can write your "code" (described in your post) in a CodeModule. This Code Module can be used like an RecorderModule wherever you want.
To insert a Module Variable in a code module, do a click with the right mouse button in the code and select Insert Module Variable.
The variable could be bound like variables within RecorderModules.
To do e.g. some initialization, execute the CodeModule with the initialization code before starting your SUT (System under Test).
Information about working with code are available here.
If you want to set variables to different values depending on the computer you start it on, you can use command line arguments as described in this topic of the Ranorex User Guide.
Regards,
Martin
Ranorex Support Team
Re: Global Variables
HI admin,
I wanna make a global variable in code . and access all the local variables of all the modules (Test modules).
is there any possibility in achieving that?
thanks and Regards,
Praneeth Arnepalli
I wanna make a global variable in code . and access all the local variables of all the modules (Test modules).
is there any possibility in achieving that?
thanks and Regards,
Praneeth Arnepalli
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Global Variables
Hello,
You can use global parameters in order to make the trick!
Please read the section Combining Variables with Parameters in order to get more information how to use global parameters.
Regards,
Bernhard
You can use global parameters in order to make the trick!
Please read the section Combining Variables with Parameters in order to get more information how to use global parameters.
Regards,
Bernhard