Storing variable value

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
generalecaster
Posts: 20
Joined: Thu May 09, 2013 10:44 am

Storing variable value

Post by generalecaster » Thu May 09, 2013 10:54 am

Hi all,

I neet to store the value of a variable in the test case TC1 and use it in TC2 on the same level.
I'm trying storing the value in an unbound variable, but it's non visible in the other TC.
I've tried using Data Source, binding 2 vars (1 for TC1 and 1 for TC2) to its row, but it not works.
My last try is using this code:

Code: Select all

[language=csharp]
NumeroPolizza = "XYZ";
var dataConn = DataSources.Get("myDataSource");
dataConn.Rows.Add(new string[] { NumeroPolizza });
dataConn.Store();
[/language]
but ... nothing ...

The structure of my Test case is:

GENERAL_TEST_CASE
-----TC1
----------RECORDING1
-----TC2
----------RECORDING2

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 variable value

Post by Support Team » Mon May 13, 2013 1:08 pm

Hi,

In order to pass the value of a variable from one test case to another you could use a global parameter.
You could bind the different variables of the test cases to one global parameter. This will ensure that the value of the variable of the "next" test case will be set to the value of the variable of the first test case.

Regards,
Markus
.
Image