-1

I have a requirement where in I need to execute all the suites in the testng.xml file for a number of times say 5.I know how to run a single test case multiple times by using invocationcount attribute but I don't have any idea how to run a suite multiple times.Any help will be appreciated a lot

Praveen
  • 201
  • 5
  • 18

1 Answers1

1

Then you can write a script a batch file which will run the testng.xml once , do things you want to do in between and then again run the same testng.xml again . That should achieve what you wnat to do

Shamik
  • 1,591
  • 2
  • 16
  • 36
  • Till now I am doing the same thing.I am running the testng.xml file from the command line(unix terminal) by putting it in a .sh file.I have a separate .sh file which invokes the first file in a for loop.But I don't want it to be like this.It should be done programatically.. – Praveen Dec 21 '14 at 16:05
  • Scripting is not programming ? You can put your logic and write a shell script. I am not clear what you mean by programatically – Shamik Dec 21 '14 at 16:16
  • programatically means,a java method should be able to pickup all the suites and iterate them for a specified number of times – Praveen Dec 22 '14 at 06:09
  • Then write a java class and in there you can execute the same command which you are executing from CLI. Please check this - http://stackoverflow.com/questions/15464111/run-cmd-commands-through-java . You can put your own logic in the java class. – Shamik Dec 22 '14 at 06:30