Forum Discussion

nb's avatar
nb
New Contributor
9 years ago

How to automate soap ui projects to run all the project in one click

Hi Team,

 

In my work space there are several soap ui projects. I want to run all the soap ui project in single click so that it can save my lot of time.

 

Can any one please let me if soap ui provide any feature to implement this. Is load runner is useful for this ? From where I can get the load runner .bat file.

 

Thanks in Advance...!!

  • nmrao's avatar
    nmrao
    Champion Level 3
    I remember there was another thread on the same question, couldn't recollect though.

    How are you currently running a project ?

    If the answer is command-line using testrunner, create a wrapper batch file and include to execute all the your projects in each line.
  • KarelHusa's avatar
    KarelHusa
    Champion Level 2

    You can execute all test cases from your worspace by the following Groovy script:

     

    import com.eviware.soapui.model.testsuite.*
    import com.eviware.soapui.support.types.StringToObjectMap
    import com.eviware.soapui.SoapUI
    
    project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("Project1")
    
    for(project in SoapUI.workspace.projectList) {    
      log.info project.getName()
    
      project.getTestSuiteList().each {
    	TestSuite ts = it
    	List<TestCase> tcs = ts.getTestCaseList()
    	tcs.each {
    		TestCase tc = it
    		log.info "Running " + project.getName() + " " + tc.getName()
    		tc.run(new StringToObjectMap(), false)
    	}
      }
     }
     

    You can modify the script to choose the suits, test cases etc.

     

    You can execute the script e.g. if you create a new project/test suite/test case and define a Groovy script test step. Then you launch this step to execute the script, just avoid the infinite loop.