Forum Discussion

rah's avatar
rah
Occasional Contributor
15 years ago

CommandLine Tool - is there a way to accessing other projects ?

I have a workspace with several projects. When I receive a certain request in a MockService from project A, I run a test case from Project B, by the following groovy script.

project =context.getMockRunner().getMockService().getProject().getWorkspace().getProjectByName(project_name)
testSuite = project.getTestSuiteByName(suite_name);
testCase = testSuite.getTestCaseByName(testcase_name);
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

This works perfectly fine within the soapUI GUI.

But when I start the MockService of A via command line it is not able to access project B since the workspace is null.
Is there another way to get access to project B or is the only solution to pack everything into one big project?

Thanks a lot for your help
--rah

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Technically it is possible. You could for instance run another TestCase using the SoapUITestCaseRunner.


    def runner = new SoapUITestCaseRunner()
    runner.setProjectFile( "path-to-your-soapui-project-B.xml" )
    runner.setTestSuite( "YourTestSuite" )
    runner.setTestCase( "YourTestCase" )
    runner.run()


    Regards,
    Dain
    eviware.com