would you please have look at my issue and see if you can help me? this is the Json response which includes the delays added on a task. I want to create a script assertion in SoapUI to check whether "taskid" in response is equal TaskId value in the testcase property or not?
[{
"delayid": 7,
"delaytypeid": 1,
"autogrowminutes": 0,
"seconds": 1800,
"versionautoid": 10001308,
"deleted": false,
"taskid": 1163,
"isprestartdelay": false,
"starttime": "2018-02-06 09:30:00"
}]
my script assertion:
import groovy.json.JsonSlurper;
def slurper = new JsonSlurper();
def response = messageExchange.response.responseContent;
def parsedJsonResponse = slurper.parseText(response);
def tcTaskId =messageExchange.modelItem.testCase.getPropertyValue("taskId");
assert !(parsedJsonResponse.isEmpty())
assert parsedJsonResponse.taskid==tcTaskId
I got this error :
assert parsedJsonResponse.taskid==tcTaskId | | | | | [1163]| 1163 | false [[autogrowminutes:0, delayid:7, delaytypeid:1, deleted:false, isprestartdelay:false, seconds:1800, starttime:2018-02-06 09:30:00, taskid:1163, versionautoid:10001308]]
it compares the [1163] with 1163 so result is false, how can I convert them to the same type?
Thank you