maven - testng specify different Users -


I'm running our automated tests using testNG We chose TestGiven because we tested methods examples public zero Can send variable input in testXX (String User ID) and UserAid can change for each test.

The code below shows the three different user IDs I can use to execute my tests. My exact test will run three times for each of three different users This feature is great and actually enables me to do many tests in different situations because each of our users take different profiles

  // All valid pricing leads @ dataprider (name = "UserIIDS") public object [] [] createPricingLeadUsersParameters () {Return to new object} [] {{"TestUser001"}, {"TestUser002"}, {"TestUser003"}}; } @Test (dataProvider = "userIds") Public Zero Group (String UserIDs) {............}   

I am having problems now. I can use only one user id during or not, all my tests will fail. I would like to do my exact test but will not be shown to the user only, which are not shown above three. It is a way of configuring Testenian to create this variable on the command line, so many times I use three definitions But, under another condition, would it be only one of three or a new user ID?

Of course, there are several ways to do this.

  java -dfoo = bar org.testng.TestNG ...   

and then with your data provider foo Code> System.getProperty () and adjust that it returns back accordingly.

Comments