Storing values in data variables

Ask general questions here.
tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Storing values in data variables

Post by tallahassee101 » Thu Mar 17, 2011 3:43 pm

Is it possible with the new "Variables" in Ranorex 3.0 to get a value from an accessible element and store that in the variable in the recording (rxec) mode? Or do I have to create user code to store the value from that variable?
We are doing this in user code for many items right now in order to validate:
Accessible accElement1 = new Accessible(repo.Item);
RecordingFile.ItemValue = (string)accElement1.Value;

I just hate having a ton of user code to do this.

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

Re: Storing values in data variables

Post by Support Team » Fri Mar 18, 2011 12:54 am

Hello,

there is no action to do that.

What is the purpose of you doing so? Maybe we can help you reach that goal in a different way.

Regards,
Roland
Ranorex Support Team
.
Image

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Storing values in data variables

Post by tallahassee101 » Mon Mar 21, 2011 7:17 pm

We have values in a table that are being transmitted, so we are verifying that the values are being transmitted properly. We can bring up both sides of the transmitted table in our application so we are reading the variables in the original table and setting them to variables in user code and then comparing those variables to the transmitted table to make sure they match.
Table A
x = 1
y = 80
z = stringXYZ

Table B
x = 1
y = 80
z = stringXYZ

I want to generate the values ( so 1, 80, and stringXYZ are values within a range of values we test ), type that value into the column in Table A. Then verify that table B updates with the same value.

It seems like I should be able to generate the value through user code and assign it to a variable and then use that variable in the verification.

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

Re: Storing values in data variables

Post by Support Team » Mon Mar 21, 2011 10:20 pm

Hello,

since that is no action for GetValue you need to do that in code.

Here is an example

Code: Select all

			for (int i = 2; i < 4; i++)
			{
				Ranorex.Cell c = string.Format("/form[@controlname='formVipApplication']/table[1]/row[{0}]/cell[1]",i);
				Ranorex.Cell c_other = string.Format("/form[@controlname='formVipApplication']/table[2]/row[{0}]/cell[1]",i);
				
				Validate.AreEqual(c.Text,c_other.Text);
			}

Regards,
Roland
Ranorex Support Team
.
Image

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Storing values in data variables

Post by tallahassee101 » Tue Mar 22, 2011 4:56 pm

It seems as if this could work if the "Set Value" action allowed the user to set a variable's value. I don't understand why Set Value restricts having a variable in the "Name" parameter, this would allow for a lot more flexibility. Consider this a feature request if this is possible?

Thank you

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

Re: Storing values in data variables

Post by Support Team » Tue Mar 22, 2011 6:35 pm

Hello,

yes, you are right. I'll file a feature request.

Regards,
Roland
Ranorex Support Team
.
Image