Ask a Question

How to get the current count of Data-Driven Loop by using script?

SOLVED
Josh_147
Contributor

How to get the current count of Data-Driven Loop by using script?

Hi all,

 

I have a Data-Driven Loop and the data variable is a .csv file.

 

Is there any way to know the current count number of the running Data-Driven Loop? The simplest way could be adding the numbers in .csv file but I'm trying to not doing that.

Is it possible to get the count number by using script?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: How to get the current count of Data-Driven Loop by using script?

Hi,

 

I am not sure that data-driven loop provides a loop counter, so either add a column to the datafile as you already suggested or implement a counter variable in your test code. (Exact implementation may depend on how data-driven loop is implemented in your case.)

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

1 REPLY 1
AlexKaras
Community Hero

Re: How to get the current count of Data-Driven Loop by using script?

Hi,

 

I am not sure that data-driven loop provides a loop counter, so either add a column to the datafile as you already suggested or implement a counter variable in your test code. (Exact implementation may depend on how data-driven loop is implemented in your case.)

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: