0
votes

SoapUI provides the " Run TestCase feature " :

https://www.soapui.org/docs/functional-testing/teststep-reference/run-testcase.html

The problem is that I cannot only use it to target a TestCase from another TestSuite.

I know I can achieve this via Groovy scripting but I would like to use the graphical interface.

Is there a way to call a TestCase from another TestSuite via the graphical interface ?

Thank you!

2
As per the link you provided: you select Target TestSuite and Target TestCase. What else do you need? - SiKing
The problem is that the only TestSuite displayed in the TestSuite input is the one containing the TestCase I am working one, although I have many other TestSuites in the same project. I cannot select another TestSuite. - Wenneguen
That sounds like a bug ... or some problem with your setup. I use this feature all the time with no problems. Run TestCase is a Pro- feature, so you should be able to file a bug with them: support.smartbear.com/readyapi/docs/support.html - SiKing
I can see it working in soapUI 5.4 and ReadyAPI 2.5. You could test it using the sample projects that come with soapUI and see if you get the same behaviour as in your project. - craigcaulfield
Actually my bad, what I cannot do is select a TestCase from another project. Selecting a TestCase from another TestSuite works fine in a single project. Is there a way to call a TestCase from another project ? - Wenneguen

2 Answers

1
votes

To call a test case in another project, you'll have to use a Groovy test step. Assuming your projects are in the same workspace, you could use:

def workspace = testRunner.testCase.testSuite.project.workspace
def testCase = workspace
    .getProjectByName("Sample SOAP Project Core")
    .getTestSuiteByName("Simple TestSuite")
    .getTestCaseByName("Simple Search TestCase")

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

I used the sample projects that came with soapUI. The above code lives in a test case in Sample REST Project and calls a test case in Sample SOAP Project Core.

0
votes
// Replace names of a project, test suite, case and step with those you need.

// Connecting to the test step in another project.
def prj = 
testRunner.testCase.testSuite.project.workspace.getProjectByName("ProjectName")
tCase = prj.testSuites['TestSuiteName'].testCases['TestCaseName']
tStep = tCase.getTestStepByName("TestStepName")

// Calling the test runner and checking if it can run the specified step.
def runner = tStep.run(testRunner, context)
log.info ("runner status ....... : " + runner.hasResponse())