Count number of executions of parameterized test

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Count number of executions of parameterized test

Maria Gavrilova
Hello

We have one test with parameters set using data provider (for example, 30 sets of parameters, so test will be run 30 times)

Is there any possibility to count number of test runs before test starter

I want to see in console something like "running 1 of 30"

In earlier version of TestNG we used method testNGMethod.getParameterInvocationCount()
It returned 30, because number of invocations has been set in invokeDataProvider method (DataProvider.length = number of parameter invocations)

After update to TestNG 6.11 is doesn't work any more and getParameterInvocationCount() returns 0 when test started

Please, advice, is it a correct behavior for getParameterInvocationCount() method
and how to count number of tests

Thanks in advance

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Count number of executions of parameterized test

Todd Bradley-2
Your data provider knows how many parameters it generates, so why not have it store that value in a static variable in the class containing the @DataProvider method?


Todd.



On Wed, Dec 27, 2017 at 9:29 AM Maria Gavrilova <[hidden email]> wrote:
Hello

We have one test with parameters set using data provider (for example, 30 sets of parameters, so test will be run 30 times)

Is there any possibility to count number of test runs before test starter

I want to see in console something like "running 1 of 30"

In earlier version of TestNG we used method testNGMethod.getParameterInvocationCount()
It returned 30, because number of invocations has been set in invokeDataProvider method (DataProvider.length = number of parameter invocations)

After update to TestNG 6.11 is doesn't work any more and getParameterInvocationCount() returns 0 when test started

Please, advice, is it a correct behavior for getParameterInvocationCount() method
and how to count number of tests

Thanks in advance

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--
Sent from Gmail Mobile

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.