Forum Discussion

Pritish_Panda's avatar
Pritish_Panda
Contributor
9 years ago

Running a Rest project through Groovy script .

Hi ,

 

I want to run one Rest project from another project by using groovy Script .

How can I run a Rest Project through Groovy script ?

 

Thanks 

Pritish Panda

 

 

 

  • Hi All,

     

    I got the solution ,

     

    //get the Backward Project
    def getProjectName=testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName(BACKWARD_PROJECT_TAG)

     

    //Execute the Backward Project
    getProjectName.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

     

     

    Thanks 

    Pritish Panda

  • abhayguna's avatar
    abhayguna
    Occasional Contributor

    Hi Pritish,

     

    You can execute particular test step of another project from your current project. This may help you.

     

    testRunner.testCase.testSuite.project.getWorkspace().projects[Project name].testSuites[Suite name].testCases[Test case Name].testSteps[Test Step name].run(testRunner, context)

     

     

    In addition, you can get the list & refer to the test suites and test cases available in another project. So you can keep the above step in loop and can execute individual tests.

     

    Thank you,

    Suman

     

  • Hi All,

     

    I got the solution ,

     

    //get the Backward Project
    def getProjectName=testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName(BACKWARD_PROJECT_TAG)

     

    //Execute the Backward Project
    getProjectName.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

     

     

    Thanks 

    Pritish Panda

  • //Replace ProjectName with your project

    def prj = testRunner.testCase.testSuite.project.workspace.getProjectByName("ProjectName")
    prj.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

     

    Thanks,

    Chaitan.

  • // Replace Project_Name with your project.
    def prj = testRunner.testCase.testSuite.project.workspace.getProjectByName("Project_Name")
    prj.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)