I have a string variable whichSet
that can hold either 3 values "prd", "stg" and "int". In the Test I want to pass the value as dataProvider like this:
@Test(enabled = true, dataProvider = whichSet, dataProviderClass = TestDataProvider.class)
But i have the below error:
The value for annotation attribute Test.dataProvider must be a constant expression
I've already had 3 providers defined as:
@DataProvider(name="stg")
@DataProvider(name="prd")
@DataProvider(name="int")
Since i'm reading the data provider from another class (not in the test class), so i'm not able to pass the value to that class based on some test condition. Anyway that I can make the dataProvider = whichSet
work? Thank you