Top Description Methods
org.testng.annotations

public @Interface DataProvider

extends Annotation
Annotations
@Retention:RUNTIME
@Target:METHOD
@Documented
Static Imports
java.lang.annotation.ElementType.METHOD

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:

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.

Method Summary

Modifier and TypeMethod and Description
public boolean

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.
cacheDataForTestRetries
()

public int[]

Returns:

the value
indices
()

Which indices to run from this data provider, default: all.

public String

Returns:

the value (default empty)
name
()

The name of this DataProvider.

public boolean

Returns:

the value (default false)
parallel
()

Whether this data provider should be run in parallel.

public boolean

Returns:

the value
propagateFailureAsTestFailure
()

Helps TestNG decide if it should treat data provider failures as test failures.

public Class<? extends IRetryDataProvider>

Returns:

- An Class which implements IRetryDataProvider and which can be used to retry a data provider.
retryUsing
()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

cacheDataForTestRetriesback to summary
public boolean cacheDataForTestRetries()
Returns:boolean

- true if TestNG should use data returned by the original data provider invocation, when a test method fails and is configured to be retried.

indicesback to summary
public int[] indices()

Which indices to run from this data provider, default: all.

Returns:int[]

the value

nameback to summary
public String name()

The name of this DataProvider.

Returns:String

the value (default empty)

parallelback to summary
public boolean parallel()

Whether this data provider should be run in parallel.

Returns:boolean

the value (default false)

propagateFailureAsTestFailureback to summary
public boolean propagateFailureAsTestFailure()

Helps TestNG decide if it should treat data provider failures as test failures.

Returns:boolean

the value

retryUsingback to summary
public Class<? extends IRetryDataProvider> retryUsing()
Returns:Class<? extends IRetryDataProvider>

- An Class which implements IRetryDataProvider and which can be used to retry a data provider.