Fetching DataProvider Array

22 views
Skip to first unread message

Baubak

unread,
Aug 28, 2021, 8:14:15 AM8/28/21
to testng-users
Hi There,

Wanted to know if there is, given a test method with data providers,  a TestNG method that gives us the value of that method's dataProvider?

example:

@PhasedTest(canShuffle = true)
public class PhasedSeries_L_ShuffledDPSimple {
    
    @DataProvider(name = "create2")
    public static Object[][] createData() {
        return new Object[][] {{"Z"},{"M"}};
    }
   

@Test(dataProvider = "create2")
 public void step1(String val) {
        // System.out.println("step1 " + val);
         //PhasedTestManager.produceInStep("A");
     }
}

What I want is to fetch the data provider in a listener before it is injected.

In this case it will return : {{"Z"},{"M"}}.

I would appreciate a simple solution if possible. I have a solution in mind but it seems a bit complicated.

Best regards,

Baubak

⇜Krishnan Mahadevan⇝

unread,
Aug 30, 2021, 2:00:15 AM8/30/21
to testng-users
Can you please check if org.testng.IDataProviderInterceptor fits your needs ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/a86be5a3-ce9b-4278-af6c-e38d37f2f11bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages