Repo Variables

Class library usage, coding and language questions.
j.early
Posts: 32
Joined: Fri Jun 15, 2012 12:14 pm

Repo Variables

Post by j.early » Mon Aug 27, 2012 11:09 am

Hello all,

another quick question.

I have a recording that performs the normal File open action. In the folder where my test data is, there is 10 demo images.

The first 3 tests use 1 image and then then next 3 use another and so on.

I have the following XPath: */*/row/cell[@text=$SwimmingAlgae]

The above is set t a variable "$SwimmingAlgae" for the first 3 tests,but the next 3 need to be using "$WallDemo"

If I change this in the repo it affects ALL test recordings. So the first 3 get changed to using "$WallDemo" instead of "$SwimmingAlgae" which I don't want.

Any help in forcing this to stop would be great.

Regards
Joe

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Repo Variables

Post by Support Team » Mon Aug 27, 2012 1:45 pm

Hi,

Are you using the Data Driven approach?
Are you working with the repository or is this a RxPath from UserCode?
Do you have already tried setting the first variable to different values instead of changing the variable itself?

Regards,
Markus
Ranorex Support Team
.
Image

j.early
Posts: 32
Joined: Fri Jun 15, 2012 12:14 pm

Re: Repo Variables

Post by j.early » Mon Aug 27, 2012 2:09 pm

Working with the repository and setting variables in there.

So in the repository I have an object named "TestImages" with 9 variables assigned. This object is only used in 1 recording, which gets executed for every test case.

At the moment, I right clicked on this "TestImages" object and selected "Make Item Variable" from within a recording and filled out the ones I require (9 in total).

The issue is when I change the variable for one test case, it affects them all. (which is understandable).

How can I avoid this, is user code the best way?

Thanks
J

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Repo Variables

Post by Support Team » Mon Aug 27, 2012 3:41 pm

Hi,

You shouldn't change the repository variable, you should use another recording variable or set the specific recording variable via the data connector to another value.
For more information please take a look at the following links:
Lesson 3: Data-Driven Testing
Using Variables with Code Modules

Regards,
Markus
Ranorex Support Team
.
Image