yuraku
8 years agoContributor
JsonPath Existence Match is valid even in case of wrong expected result
Hi.
in my case JsonPath Existence Match is valid even in case of wrong expected result.
When i have true in expected result and false in response, assertion is passed
Also maybe some one can help me to write correct script:
i need to check job status and only if status is true i need to go to other step, if false i need to run previous step again.
import groovy.json.JsonSlurper def jsonSlurper = new JsonSlurper() def response = testRunner.testCase.testSteps["Check Job Status"].testRequest.response.contentAsString log.info(response) def responseObject = jsonSlurper.parseText(response) if (String.valueOf(responseObject.Successful).equals(false)) testRunner.gotoStepByName( "Check Job Status") else testRunner.gotoStepByName( "Get Job Result")
Thanks in advance.