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
Asked
Active
Viewed 930 times
-1
-
Extremely vague question. What is this 'suite'? what kind of program is it? is it sqlplus or java? is it something you run on a linux system? why is ssh tagged? – Rnet Dec 20 '14 at 11:30
-
Well how are you running the testcases now ? Ant ? – Shamik Dec 20 '14 at 17:50
-
not through ant.I am using testng.xml file – Praveen Dec 20 '14 at 17:59
-
how do you run the test ? – Shamik Dec 20 '14 at 19:44
-
I am running from command line – Praveen Dec 21 '14 at 05:55
-
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 Dec 21 '14 at 11:03
1 Answers
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