Hi,
I am currently using repository variables in Ranorex and I have a question
When I update the repository variable it does not get reflected to the correct object.
For example:- say ImageSegment is my repository variable used in ImageSegmentElement.
var myRepo = <RepositoryName>.Instance;
Repo.ImageSegment = "1"
var imageSegment = myRepo.<Someting>.ImageSegmentElement; // goes to correct element
<...Do something.. >
Repo.ImageSegment = "0"
myRepo.<Someting>.ImageSegmentElement; // the change in variable is not reflected goes to previous element.
Are we not supposed to use the variables? How to solve this issue?
Regards,
Vamsi
Use of Repository Variables
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Use of Repository Variables
I may have misunderstood your question, so I'm sorry if that's the case. As far as I understand a repository variable is a variable used within the RxPath of a repository item.
So in
What is it you're trying to accomplish?
So in
var myRepo = <RepositoryName>.Instance;"myRepo" isn't a "repository variable" it's just a regular old variable in your code.
What is it you're trying to accomplish?
Doug Vaughan
Re: Use of Repository Variables
I'm not quite sure what your code is doing since you refer to your repository with both "myRepo" and "Repo" without further explanation. However, there is a simple way to check the resolved RanoreXPath of repository items, i.e. the path with its repo variables replaced by their bound values:
Get the AbsolutePath property of a repository item info and then use the ToResolvedString method like in the following example:
Alex
Ranorex Team
Get the AbsolutePath property of a repository item info and then use the ToResolvedString method like in the following example:
var resolvedPath = myRepo.<Something>.ImageSegmentElementInfo.AbsolutePath.ToResolvedString();Regards,
Alex
Ranorex Team