I want to pass data from iteration to iteration, is that a test case?
I've included a screenshot. I'm just passing data from iteration to iteration inside the highlighted area. If you believe this is possible, I can send over our solution. Thanks

Code: Select all
//THIS DOES NOT REBIND THE DATA VARIABLES
//Refresh the data connector so that any bound variables or other data is available immediately, rather than next iteration.
foreach (Ranorex.Core.Data.DataCache cache in TestSuite.Current.DataConnectorCaches)
{
if(cache.Connector.Name == connector.Name)
{
cache.Load();
}
}
//THESE ALSO DO NOT REBIND THE DATA VARIABLES
TestCase.Current.DataContext.ReloadData();
TestCase.Current.DataContext.Source.Load();
Code: Select all
//Testing overwriting test data.
if (TestCase.Current.DataContext.CurrentRowIndex == 1)
{
Ranorex.Core.Data.RowCollection testCollection = TestCase.Current.DataContext.Source.Rows;
Reporting.LogInfoMessage("BEFORE update is applied");
for (int i = 0; i < testCollection.Count; i++)
{
Report.Info("Row #: " + i.ToString() + ": " + string.Join(",", testCollection[i].Values));
}
TestData.UpdateIterationData("Modifier", "5");
Reporting.LogInfoMessage("AFTER update is applied");
for (int i = 0; i < testCollection.Count; i++)
{
Report.Info("Row #: " + i.ToString() + ": " + string.Join(",", testCollection[i].Values));
}
}
if (TestCase.Current.DataContext.CurrentRowIndex == 2)
{
Ranorex.Core.Data.RowCollection testCollection = TestCase.Current.DataContext.Source.Rows;
Reporting.LogInfoMessage("BEFORE update is applied");
for (int i = 0; i < testCollection.Count; i++)
{
Report.Info("Row #: " + i.ToString() + ": " + string.Join(",", testCollection[i].Values));
}
TestData.UpdateIterationData("Modifier", "6");
Reporting.LogInfoMessage("AFTER update is applied");
for (int i = 0; i < testCollection.Count; i++)
{
Report.Info("Row #: " + i.ToString() + ": " + string.Join(",", testCollection[i].Values));
}
}
Reporting.LogInfoMessage("Bound Variables: " + TDValue + "," + TDModifier + "," + TDFinal);
Code: Select all
Reporting.LogInfoMessage("Bound Variables: " + TDValue + "," + TDModifier + "," + TDFinal);