Forum Discussion

tom_13's avatar
tom_13
Contributor
16 years ago

Run test Case fron another project

Hi all,
How can I run test case or test step from another project?

p.s. I'm using soap 2.5.1 free
  • zdzichukowalski's avatar
    zdzichukowalski
    Occasional Contributor
    And how to run test step from another project? I've tried something like this(Pro 3.0):


    project =testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("ProjectName")
    testSuite = project.getTestSuiteByName("TestSuiteName")
    testCase = testSuite.getTestCaseByName("TestCaseName")
    runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner( testCase,null )
    runner.gotoStepByName("FolderGetDetail")


    but it didn't work...
  • rah's avatar
    rah
    Occasional Contributor
    project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName(project_name)
    testSuite = project.getTestSuiteByName(suite_name);
    testCase = testSuite.getTestCaseByName(testcase_name);

    // run test case
    runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false) // objectMap, async
  • Hi,
    I don't see where you running step, I think you miss those string:


        runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)


    And you don't need this:
    runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner( testCase,null )
    • danielmbanks's avatar
      danielmbanks
      Occasional Contributor

      This is really useful. Any idea if it's possible to make this work through the maven plugin?

       

      Calling testRunner.getTestCase().getTestSuite().getProject().getWorkspace() returns null, I assume because the maven plugin is set-up to just run a single project. Is there a property to set the workspace location?

      • nmrao's avatar
        nmrao
        Champion Level 3

        danielmbanks,

         

        That mentioned code works only from within SoapUI tool.

         

        Because, there is workspace and user can have multiple projects.

         

        However, when running from other commandline tools, it would get null as there is no workspace.

         

        What you are trying to achieve can be done using 2nd sample of JUnit open source integration