Skip to main content

Use the values of DataProvider in annotation

No replies
sonam
Offline
Joined: 2006-05-05
Points: 0

Hi,

It's a simple TESTNG code,
@DataProvider(name="value")
public Object[][] companyValues(){
Object[][] a = {
{"US","Plus"},
{"UK","SS"}}};

@Test(dataProvider="value")
@RequiresQBOCompany(
params={"region","SKU"},
values={region,sku})
void provideDataProvider(String region, String sku){
//do some testing on the created company
}

This @RequiresQBOCompany is a annotation which creates a company based on the parameters given. What I want to know is is there any way by which I can set the values of the annotation with the values that my data provider gives me???

I have a large set of dataproviders and need to create many companies for testing the same thing. Is there a better way to do this?

Will be very grateful if anyone provides insight for this.

Thanks in advance!!

Regards,
Sonam