Error on Conditional Goto
Hi guys, I'm pretty new to Groovy and SoapUI test suite, and I'm getting an error when I try to execute a Conditional Goto. The thing is, I have a couple of REST services which answer a JSON string, and I want to create a TestSuite in which service B gets executed only if service A returns an specific code on its answer. So, to make things more clear:
Service A returns something like:
{ { "parentObject": { "myCode": "0", .... } }
If code equals to "1" I should run service B, otherwise not. My Conditional Goto is:
contains(text(), "1")
also tried with
contains(., "1")
If I test this condition from the run icon in the Conditional Goto window, it solves correctly the condition, but if I run it from the TestSuite, I get the message "Missing matching condition, moving on" and executes the service B.
There are only a few search results in Google associated to this error, and only in one of them I've found another option with a Groovy script (link):
import groovy.json.JsonSlurper responseContent = testRunner.testCase.getTestStepByName("Service A step").getPropertyValue("response") slurperresponse = new JsonSlurper().parseText(responseContent) myCode = slurperresponse.parentObject.myCode if ('1'.equalsIgnoreCase(myCode.toString())) testRunner.gotoStepByName("Service B Step") else log.info("Some error")
but it didn't work, meaning that again the service B gets executed, event when it shouldn't).
I would really appreciate if you could give me a hand here, with any of both options, if you know why the Conditional Goto is showing that error or why the Service B gets executed with the Groovy Script.
Thanks in advance