Package org.testng

Interface IDataProviderListener

All Superinterfaces:
ITestNGListener

public interface IDataProviderListener extends ITestNGListener
A listener that gets invoked before and after a data provider is invoked by TestNG.
  • 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 - - A IDataProviderMethod object that contains details about the data provider that is about to be executed.
      method - - The ITestNGMethod method that is going to consume the data
      iTestContext - - 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 - - A IDataProviderMethod object that contains details about the data provider that got executed.
      method - - The ITestNGMethod method that received the data
      iTestContext - - The current test context
    • onDataProviderFailure

      default void onDataProviderFailure(ITestNGMethod method, ITestContext ctx, RuntimeException t)
      This method gets invoked when the data provider encounters an exception
      Parameters:
      method - - The ITestNGMethod method that received the data. A reference to the corresponding data provider can be obtained via ITestNGMethod.getDataProviderMethod()
      ctx - - The current test context
      t - - The RuntimeException that embeds the actual exception. Use Throwable.getCause() to get to the actual exception.