I created a 'Common' library where I can store functions I routinely use. In the image below be advised that only the 'Locate_User' function uses a repo item which has a variable in its path ($user).
I also have a recording 'CreateOffenses' that inherits the functions from the library.
In the recording I reference the 'Enter_Current_Date' function. This function contains no repo items with variables.
When I build the solution I continually get a warning on this recording saying the variable $user is not bound to a data column. Why is this warning occurring when I am referencing a function that contains repo items without variables? If I was referencing the 'Locate_User' function I could understand this warning but I am not.
Thanks for the help
Repo Variable Displays As Unbound
-
- Posts: 94
- Joined: Tue Jun 16, 2009 10:27 pm
Repo Variable Displays As Unbound
You do not have the required permissions to view the files attached to this post.
Re: Repo Variable Displays As Unbound
I have also run into this problem and was about to post a similar question.
In addition to this issue, is there any way to hide the unbound variable warning when I manually assign a value to a repo variable in code? (e.g. repo.Variable = variable;) I would like to make my code self contained if it can find the value for itself. I can hide the warning, but that does nothing for the 70+ unbound variable notes in the rxtst file when I view it that can hide actual missing binds that aren't intentional.
In addition to this issue, is there any way to hide the unbound variable warning when I manually assign a value to a repo variable in code? (e.g. repo.Variable = variable;) I would like to make my code self contained if it can find the value for itself. I can hide the warning, but that does nothing for the 70+ unbound variable notes in the rxtst file when I view it that can hide actual missing binds that aren't intentional.
Michael Rollins
Re: Repo Variable Displays As Unbound
You can turn off the warnings in the Ranorex options, but I would not recommend it. Warnings are there to warn you about things that are important.
Also note that assigning a value to a variable is different than binding it to a data source.
I would suggest that you create a global parameter (or multiple) that would be your binding for any variable that you don't want to actually bind to another data source. You could call it "NO_BIND", for example, so everyone knows what it is used for. Then, just go through your tests and bind any variables that you don't want to see warnings for to that parameter.
This is the easiest (and in my opinion best) way to not have the warnings.
On a more base note though, the fact that there are variables for which bindings are not being created should probably be taken as a bad thing given the way Ranorex is designed. It can be done, but it probably shouldn't be. I would ask why those variables are being created, and if there might be a better way to structure the tests so that they are not needed. If the test just needs to pass a few variables around (such as row indexes or PIDs, etc.), no problem, that's what the parameters are for. But if variables are being created to hold test data, then they probably should be bound to a data source.
But that's just my opinion from my experience. Take it for what it's worth to you...
Also note that assigning a value to a variable is different than binding it to a data source.
I would suggest that you create a global parameter (or multiple) that would be your binding for any variable that you don't want to actually bind to another data source. You could call it "NO_BIND", for example, so everyone knows what it is used for. Then, just go through your tests and bind any variables that you don't want to see warnings for to that parameter.
This is the easiest (and in my opinion best) way to not have the warnings.
On a more base note though, the fact that there are variables for which bindings are not being created should probably be taken as a bad thing given the way Ranorex is designed. It can be done, but it probably shouldn't be. I would ask why those variables are being created, and if there might be a better way to structure the tests so that they are not needed. If the test just needs to pass a few variables around (such as row indexes or PIDs, etc.), no problem, that's what the parameters are for. But if variables are being created to hold test data, then they probably should be bound to a data source.
But that's just my opinion from my experience. Take it for what it's worth to you...

Shortcuts usually aren't...
Re: Repo Variable Displays As Unbound
Hi costamesakid,
I agree with krstcs, you should rethink in the first place if those unbound variables can be replaced with a data source.
If you are using dinamically created data, then you could use a .csv or simple data data container, since it is easy to manipulate those data from code, and the data can be accessed after the run also.
Best REgards,
Zoltan
I agree with krstcs, you should rethink in the first place if those unbound variables can be replaced with a data source.
If you are using dinamically created data, then you could use a .csv or simple data data container, since it is easy to manipulate those data from code, and the data can be accessed after the run also.
Best REgards,
Zoltan