Package org.testng.annotations
Annotation Type DataProvider
-
@Retention(RUNTIME) @Target(METHOD) @Documented public @interface DataProvider
Mark a method as supplying data for a test method.The
name
defaults to the name of the annotated method.The annotated method must return any of the following:
Object[][]
orIterator<Object[]>
, where eachObject[]
is assigned to the parameter list of the test method.Object[]
orIterator<Object>
, where eachObject
is assigned to the single parameter of the test method.
The
@Test
method that wants to receive data from thisDataProvider
needs to use aTest.dataProvider()
name equal to the name of this annotation.