Hi,
According to Data Driven Architecture approach, I would like to know if it's possible to get a data range value dynamically from a module variable or global parameter or column of a database table ?
As tangible benefit of using a dynamic data range value, testing projects using a database, linking between Primary and Foreign keys of entities of database schema become easy
Thanks in advance for your replay
Hicham SENOUCI
Data range value as a parameter
Re: Data range value as a parameter
Hi Senouci,
I'm not exactly sure what you want to achieve, but if I understand this correctly, the code below could help you.
Just create a code module and place it in the setup of your testsuite.
You will have to make a variable called "DataRange" and bind it to a global parameter. The parameter should contain the data range, separated through a comma. (e.g. 1,5)
Hope this helps.
Kind regards,
asdf
I'm not exactly sure what you want to achieve, but if I understand this correctly, the code below could help you.
Just create a code module and place it in the setup of your testsuite.
Code: Select all
int min_range = Convert.ToInt32(DataRange.Split(',')[0])-1;
int max_range = Convert.ToInt32(DataRange.Split(',')[1])-1;
Ranorex.Core.Testing.TestSuite.Current.GetTestCase("TestCase").DataContext.SetRange(min_range,max_range);
Ranorex.Core.Testing.TestSuite.Current.GetTestCase("TestCase").DataContext.ReloadData();
Hope this helps.
Kind regards,
asdf