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 voidafterDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) This method gets invoked just after a data provider is invoked.default voidbeforeDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) This method gets invoked just before a data provider is invoked.default voidonDataProviderFailure(ITestNGMethod method, ITestContext ctx, RuntimeException t) This method gets invoked when the data provider encounters an exceptionMethods inherited from interface ITestNGListener
isEnabled
-
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- - AIDataProviderMethodobject that contains details about the data provider that is about to be executed.method- - TheITestNGMethodmethod 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- - AIDataProviderMethodobject that contains details about the data provider that got executed.method- - TheITestNGMethodmethod that received the dataiTestContext- - The current test context
-
onDataProviderFailure
This method gets invoked when the data provider encounters an exception- Parameters:
method- - TheITestNGMethodmethod that received the data. A reference to the corresponding data provider can be obtained viaITestNGMethod.getDataProviderMethod()ctx- - The current test contextt- - TheRuntimeExceptionthat embeds the actual exception. UseThrowable.getCause()to get to the actual exception.
-