Forum Discussion

stewmoon's avatar
stewmoon
Occasional Contributor
7 years ago

Running multiple Soapui Projects from the command line

Hello,

 

I'm new to SoapUI and automation in general, so I apologize in advance for asking a question that appears to have already been asked.


I'm able to execute a single project using "testrunner.bat "c:\my projects\my-project.xml"" from the command line.  

I have about 10 soapui projects that I want to execute from the command line from 1 keystroke.
(doesn't matter the order they are executed in.)

I was thinking of creating some type of file and using a for loop to iterate through and at each step in the loop I could execute the testrunner.bat and just point it to a different project.  

I'm just not sure what type of file to create and how to execute it.  Any information would be greatly apprecaited.  I found alot of similar questions online, so feel free to link to those.  I'm currently running Windows 7.

for(int i = 0;i<=10;i++)
{
     if (int i = 0)

     {
      testrunner.bat "c:\my projects\project1.xml"
     }

     if (int i = 1)

     {
      testrunner.bat "c:\my projects\project2.xml"
     }

     if (int i = 2)

     {
      testrunner.bat "c:\my projects\project3.xml"
     }

     if (int i = 3)

     {
      testrunner.bat "c:\my projects\project4.xml"
     }

     if (int i =4)

     {
      testrunner.bat "c:\my projects\project5.xml"
     }

     if (int i = 5)

     {
      testrunner.bat "c:\my projects\project6.xml"
     }

     if (int i = 6)

     {
      testrunner.bat "c:\my projects\project7.xml"
     }

     if (int i = 7)

     {
      testrunner.bat "c:\my projects\project8.xml"
     }

     if (int i = 8)

     {
      testrunner.bat "c:\my projects\project9.xml"
     }

     if (int i = 9)

     {
      testrunner.bat "c:\my projects\project10.xml"
     }

}

  • stewmoon,
    You already know how to execute a project using command line.

    You can just create another batch file (with an extension ".bat" or ".cmd", and copy the full testrunner you would use for each project.

    Thats it. No need for the looping and all. Please give it a try.
  • nmrao's avatar
    nmrao
    Champion Level 3
    stewmoon,
    You already know how to execute a project using command line.

    You can just create another batch file (with an extension ".bat" or ".cmd", and copy the full testrunner you would use for each project.

    Thats it. No need for the looping and all. Please give it a try.