Top Description Methods
org.testng.annotations

public @Interface Factory

extends Annotation
Annotations
@Retention:RUNTIME
@Target:METHOD, CONSTRUCTOR
@Documented
Imports
java.lang.annotation.Documented, .Retention, .Target

Marks a method as a factory that returns objects that will be used by TestNG as Test classes. The method must return Object[].

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the data provider name (default none)
dataProvider
()

The name of the data provider for this test method.

public Class<?>

Returns:

the data provider class (default none)
dataProviderClass
()

The class where to look for the data provider.

public boolean

Returns:

the value (default true)
enabled
()

Whether this factory is enabled.

public int[]
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

dataProviderback to summary
public String dataProvider()

The name of the data provider for this test method.

Returns:String

the data provider name (default none)

See Also
org.testng.annotations.DataProvider
dataProviderClassback to summary
public Class<?> dataProviderClass()

The class where to look for the data provider. If not specified, the data provider will be looked on the class of the current test method or one of its super classes. If this attribute is specified, the data provider method needs to be static on the specified class.

Returns:Class<?>

the data provider class (default none)

enabledback to summary
public boolean enabled()

Whether this factory is enabled.

Returns:boolean

the value (default true)

indicesback to summary
public int[] indices()