This is a migrated thread and some comments may be shown as answers.

Data Driven Count Row/Column

6 Answers 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pravin
Top achievements
Rank 1
Pravin asked on 27 Dec 2016, 06:21 AM

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

Sort by
0
Boyan Boev
Telerik team
answered on 27 Dec 2016, 12:49 PM
Hi Pravin,

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
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Pravin
Top achievements
Rank 1
answered on 28 Dec 2016, 05:17 AM

Hi Boyan,

Thanks! This is exactly what i'm hoping to find :)

Best Regards,

Pravin

Dong Energy

0
Pravin
Top achievements
Rank 1
answered on 28 Dec 2016, 08:47 AM

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

0
Accepted
Boyan Boev
Telerik team
answered on 30 Dec 2016, 08:50 AM
Hi 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
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Pravin
Top achievements
Rank 1
answered on 03 Jan 2017, 07:05 AM

Hi Boyan, 

Thanks!! This helps to perform what i'm looking for

Many thanks again :) 

Regards,

Pravin

0
Boyan Boev
Telerik team
answered on 03 Jan 2017, 08:29 AM
Hi Pravin,

I am very happy to hear that.

If you need further assistance please let us know.

Regards,
Boyan Boev
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Pravin
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Pravin
Top achievements
Rank 1
Share this question
or