log.info("Response: "+mockResponse.getMockResult().getResponseContent())Another nice tip I found at another blog: "SoapUI limitations and workarounds : mock response test step"
If you want to use mockServices in your testcase or testsuite, but don't want to implement mockResponse steps for them, you can create (of course) mockServices for them. They can handle multple responses and use xpath expressions to choose the right response for a particular request. But running the testcase you'll need to start the mockServices that you need in the test. this can be done by in the "Setup Script" of the testCase:
def project = testCase.getTestSuite().getProject(); def mockService = project.getMockServiceByName("Name of the MockService"); mockService.start();After running the testcase/testsuite the mockservices should be stopped neatly. This can be done in the "TearDown Script":
def project = testCase.getTestSuite().getProject(); def mockService = project.getMockServiceByName("Name of the MockService"); def mockRunner = mockService.getMockRunner(); mockRunner.stop();
No comments:
Post a Comment