My question: Is it possible to determine at runtime, the number of
rows in a dataprovider array i.e., the number of times that a test
case will be invoked?
Thanks
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
On Feb 12, 8:45 pm, Cédric Beust ♔ <cbe...@google.com> wrote:
> If the data provider is the only one that can know this value, then Kartik
> is right: just have it return that value as part of its job:
>
> @Test(dataProvider = "...")
> public void myMethod(int count, ... /* other parameters */) {}
>
> It's a bit wasteful to pass this `count` at each invocation since that value
> will probably not change, but this will work fine.
>
> If this value can be known earlier, then maybe you could have a special test
> method connected to a special "count provider" that will return that value.
> The test method can store this value in a field and future test methods can
> then use that value.
>
> This is more complicated, though, so I would definitely go with Kartik's
> suggestion.
>
> --
> ***Cédric
> *
>
> On Fri, Feb 12, 2010 at 10:20 AM, Kartik Kumar <krishnan.1...@gmail.com>wrote:
>
>
>
> > I don't think you can but you can put a counter value for in your data
> > provider parameter for information.
>
> > On Fri, Feb 12, 2010 at 9:01 AM, testNgUser <johnadegb...@yahoo.co.uk>wrote:
>
> >> I recently converted from JUnit4.x to TestNG after hitting the
> >> limitations of parameterized test cases....All good with testNG so
> >> far.
>
> >> My question: Is it possible to determine at runtime, the number of
> >> rows in a dataprovider array i.e., the number of times that a test
> >> case will be invoked?
>
> >> Thanks
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "testng-users" group.
> >> To post to this group, send email to testng...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> testng-users...@googlegroups.com<testng-users%2Bunsubscribe@google groups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to testng...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > testng-users...@googlegroups.com<testng-users%2Bunsubscribe@google groups.com>