Package org.testng.annotations
Annotation 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 this DataProvider
needs
to use a Test.dataProvider()
name equal to the name of this annotation.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
int[]
Which indices to run from this data provider, default: all.The name of this DataProvider.boolean
Whether this data provider should be run in parallel.boolean
Helps TestNG decide if it should treat data provider failures as test failures.Class<? extends IRetryDataProvider>
-
Element Details
-
name
String nameThe name of this DataProvider.- Returns:
- the value (default empty)
- Default:
- ""
-
parallel
boolean parallelWhether this data provider should be run in parallel.- Returns:
- the value (default false)
- Default:
- false
-
indices
int[] indicesWhich indices to run from this data provider, default: all.- Returns:
- the value
- Default:
- {}
-
propagateFailureAsTestFailure
boolean propagateFailureAsTestFailureHelps TestNG decide if it should treat data provider failures as test failures.- Returns:
- the value
- Default:
- false
-
cacheDataForTestRetries
boolean cacheDataForTestRetries- Returns:
- -
true
if TestNG should use data returned by the original data provider invocation, when a test method fails and is configured to be retried.
- Default:
- true
-
retryUsing
Class<? extends IRetryDataProvider> retryUsing- Returns:
- - An Class which implements
IRetryDataProvider
and which can be used to retry a data provider.
- Default:
- org.testng.IRetryDataProvider.DisableDataProviderRetries.class
-