Package org.testng
Interface IDataProviderListener
- All Superinterfaces:
ITestNGListener
A listener that gets invoked before and after a data provider is invoked by TestNG.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
afterDataProviderExecution
(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) This method gets invoked just after a data provider is invoked.default void
beforeDataProviderExecution
(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) This method gets invoked just before a data provider is invoked.default void
onDataProviderFailure
(ITestNGMethod method, ITestContext ctx, RuntimeException t) This method gets invoked when the data provider encounters an exception
-
Method Details
-
beforeDataProviderExecution
default void beforeDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) This method gets invoked just before a data provider is invoked.- Parameters:
dataProviderMethod
- - AIDataProviderMethod
object that contains details about the data provider that is about to be executed.method
- - TheITestNGMethod
method that is going to consume the dataiTestContext
- - The current test context
-
afterDataProviderExecution
default void afterDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) This method gets invoked just after a data provider is invoked.- Parameters:
dataProviderMethod
- - AIDataProviderMethod
object that contains details about the data provider that got executed.method
- - TheITestNGMethod
method that received the dataiTestContext
- - The current test context
-
onDataProviderFailure
This method gets invoked when the data provider encounters an exception- Parameters:
method
- - TheITestNGMethod
method that received the data. A reference to the corresponding data provider can be obtained viaITestNGMethod.getDataProviderMethod()
ctx
- - The current test contextt
- - TheRuntimeException
that embeds the actual exception. UseThrowable.getCause()
to get to the actual exception.
-