Hi Team,
I'm looking for a way to count my Local Data rows (or columns) and perform a specific function if a particular row is hit. The idea is something like the attached image.
I can't seem to find any resources in the net for this. I'm just being introduced to Telerik so i'm learning as it goes and i'm really hoping you guys can help to give some pointers on this question.
Many many thanks in advance :)
Thanks,
Regards,
Pravin
praja@dongenergy.dk
6 Answers, 1 is accepted
Here is an example of a coded step:
if
(ExecutionContext.ActiveDataRows.Count<3)
{
Log.WriteLine(
"The rows are less than 3"
);
}
else
{
Log.WriteLine(
"The rows are are equal or more than 3"
);
}
Let me know if that helps.
Regards,
Boyan Boev
Telerik by Progress
Hi Boyan,
Thanks! This is exactly what i'm hoping to find :)
Best Regards,
Pravin
Dong Energy
Hi Boyan,
Following up with the question, i'm trying to use CurrentDataRow property into my data driven testing but can't seem to get it right. The idea is simply to execute test "x" if the current data row is "x".
But i'm not sure which method to use with CurrentDataRow properties to accomplish this. These are the code snippet
public void Login_CodedStep()
{
if (ExecutionContext.CurrentDataRow. ***** == 1 {
this.ExecuteTest("Login\\VerifyFailLogin.tstest");
}
}
Many thanks in advance :)
Best Regards,
Pravin
In this case you should type the exact column name so Test Studio can determine which column you use if you have more than one:
if
(Data[
"ColumnName"
].ToString()==
"3"
)
{
Log.WriteLine(
"The current row is 3"
);
}
else
{
Log.WriteLine(
"The current row is not 3"
);
}
Let me know if that helps.
Regards,
Boyan Boev
Telerik by Progress
Hi Boyan,
Thanks!! This helps to perform what i'm looking for
Many thanks again :)
Regards,
Pravin
I am very happy to hear that.
If you need further assistance please let us know.
Regards,
Boyan Boev
Telerik by Progress