Need help in using a single @Factory method for multiple classes.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Need help in using a single @Factory method for multiple classes.

Rejish R

I have a use case that for some package say. packageA, I have multiple classes say, class A, Class B, Class C. and each class having different tests in it.
So I want all my class to use a same CSV file. Each test will send some unique id, based on which I can filter the data and send the appropriate data. In this way, I dont have to read the same csv file for each test. instead just filter the data.

 - Class A
      - Test A1{ID=1}
      - Test B1{ID=2}
 - Class B
      - Test A12{ID=1}
      - Test B12{ID=3}
 - Class C
      - Test A13{ID=1,2}
     - Test B13{ID=3,4}
CSV - Common.Csv

Solution: One way I thought was when I get a call for packageA, I will use OnStart(Isuite isuite) to load a map and set it in suite context but this works when using dataProvider at @Test level, but it doesn't work with @Factory.

Looking for some better solution.

Thanks in advance.


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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at
For more options, visit