I am trying to figure out something like below mentioned and need to automate:-
Lets assume I have 2 countries and 2 browser and 4 devices to test and only have one “testclass” for login page.
User id and password are same for both the locations. Only changes are in desired capabilities (deviceid, udid).I do not want to hardcode the location and browser into the testclass so I created another one which holds the variable.
So i have created Constants.java page and mentioned like below details
public static final String Location = “XX”;
public static final String Location = “YY”;
In the testclass I would call it e.g
CommonExcelUtil.updateTheResponseIntoCSVFile(dtf.format(now), “login”, Constants.Location);
However everytime i have to change the location manually in Constants.java page .
My Question is how can I select before I start the test the other browser or location without always changing the code at the testclass(ex-Constants.java page ).