Page 1 of 1

Storing values in data variables

Posted: Thu Mar 17, 2011 3:43 pm
by tallahassee101
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.

Re: Storing values in data variables

Posted: Fri Mar 18, 2011 12:54 am
by Support Team
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

Re: Storing values in data variables

Posted: Mon Mar 21, 2011 7:17 pm
by tallahassee101
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.

Re: Storing values in data variables

Posted: Mon Mar 21, 2011 10:20 pm
by Support Team
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

Re: Storing values in data variables

Posted: Tue Mar 22, 2011 4:56 pm
by tallahassee101
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

Re: Storing values in data variables

Posted: Tue Mar 22, 2011 6:35 pm
by Support Team
Hello,

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

Regards,
Roland
Ranorex Support Team