Hi,
In the variables window there are 3 colors to denote the variable's state: Black - In Use, Green - In use from Repo, Yellowish Brown - Not in Use. We are experiencing an issue where we want to use a variable from our Repo within the recording ( called "TrackNumber" ), however when we use it as part of a Key Sequence or in the Validation column for an AttributeEqual-AccessibleValue parameter the variable's color in the Variables Window changes from Green to Black. Once it shows up as Black the test no longer works because it overwrites the repo value. The only way we've found to revert this problem is to convert any code that uses the argument to user code and specify explicitly the repo version of the variable i.e. "repoName.TrackNumber".
This is a defect, as it is new in Ranorex 3.3, we have several recordings that used to work in 3.2 that now do not read the repo value correctly. It seems as if there are two options for the variable's use within the recording the user should have a choice. A right click or a pull down would be nice to allow us to select "Use from Repo".
As a side note passing the variable as an argument for user code seems to work as expected. The variable remains Green in the variables window when used only as an argument.
Thanks,
-Nick
Variable binding overwriting repository
-
- Posts: 169
- Joined: Thu Jan 13, 2011 2:06 pm
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Variable binding overwriting repository
Hello Nick,
Thank you for the report.
When a repository variable is used in a recording module it will be set with the standard value you set in the module variable browser for this repository variable. This behavior is implemented by design in Ranorex and is the same as in version 3.2.
We will treat your post as feature request and we will discuss this issue.
If I didn't understand you correctly please send us a project with the issue.
Regards,
Bernhard
Ranorex Support Team
Thank you for the report.
When a repository variable is used in a recording module it will be set with the standard value you set in the module variable browser for this repository variable. This behavior is implemented by design in Ranorex and is the same as in version 3.2.
We will treat your post as feature request and we will discuss this issue.
If I didn't understand you correctly please send us a project with the issue.
Regards,
Bernhard
Ranorex Support Team
-
- Posts: 169
- Joined: Thu Jan 13, 2011 2:06 pm
Re: Variable binding overwriting repository
Bernhard,
You must have misunderstood. The problem is that no value is binded to the variable in the test suite and no default value is set in the Variables Browser. The variable 'tracknumber' is still Black denoting it will not use the Repository Variable which I want it to, instead it generates a recording variable named 'tracknumber'.
Thanks,
-Nick
You must have misunderstood. The problem is that no value is binded to the variable in the test suite and no default value is set in the Variables Browser. The variable 'tracknumber' is still Black denoting it will not use the Repository Variable which I want it to, instead it generates a recording variable named 'tracknumber'.
Thanks,
-Nick
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Variable binding overwriting repository
Hi Nick,
I do the following:
I set a variable named 'tracknumber' in the repository
then i use 'Copy variable from Reopsitory'
the variable 'tracknumber will be inserted into the recording with the same default parameter as in the repository.
When i delete the value the following code will be generated in the recording.
Bernhard
Ranorex Support Team
I do the following:
I set a variable named 'tracknumber' in the repository
then i use 'Copy variable from Reopsitory'
the variable 'tracknumber will be inserted into the recording with the same default parameter as in the repository.
When i delete the value the following code will be generated in the recording.
public Recording1() { tracknumber = ""; }So the value of the repository variable will also be set to the blank value.
public string tracknumber { get { return repo.tracknumber; } set { repo.tracknumber = value; } }Regards,
Bernhard
Ranorex Support Team
-
- Posts: 169
- Joined: Thu Jan 13, 2011 2:06 pm
Re: Variable binding overwriting repository
Bernhard,
That is the behavior I am seeing that I do not want but Ranorex is doing automatically. I do not use "Copy variable from Repository" however, but the generated recording code is doing: tracknumber = ""; which overwrites my repository variable for the current recording. I want it to use the repository variable, not create a new one for the current recording.
Thanks,
-Nick
That is the behavior I am seeing that I do not want but Ranorex is doing automatically. I do not use "Copy variable from Repository" however, but the generated recording code is doing: tracknumber = ""; which overwrites my repository variable for the current recording. I want it to use the repository variable, not create a new one for the current recording.
Thanks,
-Nick
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Variable binding overwriting repository
Hi Nick,
Do you mean that you want to use the value which was set by the previous executed recording, or do you want to use the default value of the repo variable?
Regards,
Markus
Ranorex Support Team
Do you mean that you want to use the value which was set by the previous executed recording, or do you want to use the default value of the repo variable?
Regards,
Markus
Ranorex Support Team
-
- Posts: 169
- Joined: Thu Jan 13, 2011 2:06 pm
Re: Variable binding overwriting repository
Markus,
I want the recording to ALWAYS use the repo item. If I bind the variable in the test suite, set a default value in the recording, or do anything else with the variable inside the recording I want it to be with the variable from the Repository. The problem I am seeing is that there are cases when the recording decides not to use the repository variable 'tracknumber' and it creates a new variable with the identical name that it sets to "" upon initialization.
I want a way to specify to always use the repo variable 'tracknumber' and never set it to "" inside the generated cs file.
Thanks,
-Nick
I want the recording to ALWAYS use the repo item. If I bind the variable in the test suite, set a default value in the recording, or do anything else with the variable inside the recording I want it to be with the variable from the Repository. The problem I am seeing is that there are cases when the recording decides not to use the repository variable 'tracknumber' and it creates a new variable with the identical name that it sets to "" upon initialization.
I want a way to specify to always use the repo variable 'tracknumber' and never set it to "" inside the generated cs file.
Thanks,
-Nick
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Variable binding overwriting repository
Nick,
Are you working with the new Ranorex Version 3.3.1?
Did you set it to a value via User Code?
The only thing I can imagine of is that you have created a variable in a recording file which has the same name as one of your repo variables and this new variable sets the repo variable automatically to "", did you mean this?
Regards,
Markus
Ranorex Support Team
Just to clarify this, the repo item will just be set to "" when you didn't define a default value for it, if you defined one this value will also be used for the "new" recording variable when you used "Copy Variable from Repository".I want a way to specify to always use the repo variable 'tracknumber' and never set it to "" inside the generated cs file.
Are you working with the new Ranorex Version 3.3.1?
You can't use the repo variable in the recordings actions table without "copying" it, you just can directly use it in User Code.The problem I am seeing is that there are cases when the recording decides not to use the repository variable 'tracknumber' and it creates a new variable
Did you set it to a value via User Code?
The only thing I can imagine of is that you have created a variable in a recording file which has the same name as one of your repo variables and this new variable sets the repo variable automatically to "", did you mean this?
Regards,
Markus
Ranorex Support Team
-
- Posts: 169
- Joined: Thu Jan 13, 2011 2:06 pm
Re: Variable binding overwriting repository
I have three recordings that use the 'tracknumber' variable as follows:
CreateTrack
ValidateTrack
DropTrack
CreateTrack creates the track and then sets the 'tracknumber' variable. In ValidateTrack and DropTrack recordings the 'tracknumber' variable is not set, nor is there a default value for it. These two tests use the repo variable value that was set in CreateTrack.
CreateTrack
ValidateTrack
DropTrack
CreateTrack creates the track and then sets the 'tracknumber' variable. In ValidateTrack and DropTrack recordings the 'tracknumber' variable is not set, nor is there a default value for it. These two tests use the repo variable value that was set in CreateTrack.
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Variable binding overwriting repository
Hi Nik,
The repo variable will be set to "" or to the default value when you explicit copy the variable from the repository and this is by design.
In your case I would use a global parameter and bind it to the module variables from the recording files.
Regards,
Markus
Ranorex Support Team
The repo variable will be set to "" or to the default value when you explicit copy the variable from the repository and this is by design.
In your case I would use a global parameter and bind it to the module variables from the recording files.
Regards,
Markus
Ranorex Support Team