Forum Discussion

Umea_universite's avatar
Umea_universite
Occasional Contributor
12 years ago

Running a project from another project

Hello!

I wonder if there is a way to import and run a project from another project. I am aiming for a way to run all my tests (they are in different projects) with only one push of a button.

Cheers,
Rikard

2 Replies

  • Hi,

    I wonder if there is a way to import and run a project from another project.


    Out of the box no. But you can achieve this with a Groovy test step. Create a new project -> test suite -> test step -> Groovy script test step and use the following code below.

    import com.eviware.soapui.impl.WorkspaceImpl
    import com.eviware.soapui.impl.wsdl.testcase.WsdlProjectRunner

    WorkspaceImpl wi = new WorkspaceImpl("C:\\Users\\myusername\\default-soapui-workspace.xml", null) //replace with your workspace file which is usually in your user profile directory
    WsdlProjectRunner wpr = null
    def projects = wi.getProjectList()
    for (project in projects)
    {
    //log.info project
    wpr = new WsdlProjectRunner(project,null)
    wpr.run()
    }



    Regards,
    Marcus
    SmartBear Support
    • nsalomatin's avatar
      nsalomatin
      Occasional Contributor

      This is really usefull, thank you!

       

      But, how can I customize this script, if I want to run not all tests, but some of them.

      I would like to have some settings.xml file for setup list of projects which I want to run.


      Thanks in advance!