ContributionsMost RecentMost LikesSolutionsGetting test results from TestCaseRunner -> WsdlRunTestCaseHi i am implementing a feature for my tests that would log the request and response content of my failed test steps. At the moment all I see is something like "Assertion failed" etc, but I need to see what I sent in and what was returned. I am trying to read the results with some success, the code I already have is: import com.eviware.soapui.model.testsuite.* import com.eviware.soapui.impl.wsdl.teststeps.* def suiteRunner = (TestSuiteRunner) runner.getRunContext().getTestRunner() def listResults = suiteRunner.getResults() for (TestCaseRunner run : listResults){ def stepResults = run.getResults(); for(TestStepResult step : stepResults){ if(!step.getStatus().toString().equals("OK")){ def local = step.getTestStep() def caseName = local.getTestCase().getName(); def modalItem = local.getModelItem() log.info modalItem if (modalItem instanceof JdbcRequestTestStep){ log.error "TestCase " + caseName + " step " + local.getName() + " failed" log.error "JDBC step failed, query was: " + local.getQuery() log.error "Response content:" + local.getResponseContent() } if(modalItem instanceof WsdlTestRequestStep){ log.error "TestCase " + caseName + " step " + local.getName() + " failed" log.error "Request: " + modalItem.getTestRequest().getResponse().getRequest().getRequestContent() log.error "Response: " + modalItem.getTestRequest().getResponse().getContentAsXml() } if(modalItem instanceof WsdlRunTestCaseTestStep){ log.error "TestCase " + caseName + " step " + local.getName() + " failed" def target = local.getTargetTestCase() } } } } The problem is with the last IF (WsdlRunTestCaseTestStep). How do I get the steps that were run with results from the run context?Refactoring optionsI have a really big test project in soapui, consisting of many different tests for targeting different platforms and technologies (soap, http, jdbc etcetc). As the project has grown big, I really need to refactor this project as I am losing control over it. I specifically miss "What teststeps are using this test step" options (I am using a lot of Run Testcase for common parts). It is like "Find usages" in IntelliJ or i think it was "Find references" in Visual Studio. Would be really cool to have it, at the moment using grep which is not very comfortable.Re: looping while teststep passes - fails testcaseIt is very cool that i tend to figure things out 5 minutes after i have given up and come to the forum for help. The TestCase has "fail if it has any errors in any steps" option. doh.looping while teststep passes - fails testcaseI have a scenario where i am polling the database while something i expect happens (because it takes some time for stuff to happen in db). I am using groovy for looping, something similar to: def lastResult = testRunner.getResults().last().getStatus().toString() if( lastResult == 'FAILED' ) { sleep 5000 testRunner.gotoStepByName('check_email') } else { log.info 'All cool with emails' } I would expect that if the last step succeeded (doesn't care how many tries it takes) the whole case would pass, but i am getting: TestCase failed [Failing due to failed test step], time taken = 22146 And RunTestCaseLog is showing: Step 14 [Check Email] FAILED: took 10757 ms -> check_email - FAILED - 224 -> - [Script Assertion] assert count > 1.toInteger() | | | 0 | 1 false -> isOk? - OK - 5001 -> check_email - FAILED - 265 -> isOk? - OK - 5000 -> check_email - OK - 229 -> isOk? - OK - 0 TestCase failed [Failing due to failed test step], time taken = 22146 How can i make the testcase pass.setting operation manually in mocki am doing some webservice testing and several of those webservices and requests to those (from UI to mock) services are broken. The problem is that i am receiving Missing operation for soapAction [] and body element [...] , because incoming requests don't have soapAction defined nor using namespaces the way that mock could decide which operation it is. Now i have the corresponding responses in mock, but how can I tell the mock that some certain request corresponds to certain operation that should be handled by mock. I have already tried setting the soapAction in OnRequest script of mock service using mockRequest.setSoapAction(action) , where action is the action that i get when I run the request using SoapUI itself (so it should be correct one), but still it is not working and i get the same DispatchException. Second thing I would like to try is to set the mockRequest.setMockOperation(operation) , but i cant figure how to properly initiate com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation . Can anybody help me with this? At the moment I am using in OnRequest: if(mockRequest.requestContent.contains("some_unique_stuff")){ def content = """ string content of the request that works """ mockRequest.setRequestContent(content); } This is working, but it is really ugly. Re: [R]Missing operation for soapAction [] and body element, mocNo replys needed here. Figured it out.Re: mock error in browser using OnRequest scriptyes. all good now.[R]Missing operation for soapAction [] and body element, mocHi, I am receiving DispatchException on my mockservice when requesting responses from mock thru web client. In mock logs i see: com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [] and body element [{xxxx.xxxx/producer}list_documents] with SOAP Version [SOAP 1.1] at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.findOperationForRequest(SoapUtils.java:359) at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:250) at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:375) at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:715) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) If i query the same thing thru soapUI everything works. On my mock properties, the "Require SOAP Action" is set to false. It doesn't happen with all of the WSDLs, but only some of them. What could be the problem?Re: mock error in browser using OnRequest scriptIt is sad to be stupid. You have to check what is coming in, so before anything you check: if( mockRequest.httpRequest.method == "POST" )Re: mock error in browser using OnRequest scriptping.