I have the following response:
{
“-1”:[{
“-1”:{
“totalExecutions”:0
}
“1”:{
“totalExecutions”:2
}
}]
}
I want to check verify the value of totalExecutions tag value for “-1” which is “0”.
I have the code below:
def search_test_cycle = WS.sendRequest(findTestObject(‘JIRA/ZAPI-Get List of Cycle’, [(‘authorization’) : GlobalVariable.JIRA_Authorisation, (‘projectId’) : GlobalVariable.JIRA_Project_ID, (‘url’) : GlobalVariable.JIRA_URL, (‘versionId’) : ‘’, (‘cycleId’) : ‘’, (‘issueId’) : ‘’]))
WS.verifyResponseStatusCode(search_test_cycle, 200)
WS.verifyElementPropertyValue(search_test_cycle, ‘-1.-1.totalExecutions’, ‘0’)
However, I get the error below:
Unable to verify element property value (Root cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:e[0;39m
e[31mScript1.groovy: 1: unexpected token: -
I tried using the following:
WS.verifyElementPropertyValue(search_test_cycle, ‘'-1.-1.totalExecutions'’, ‘0’)
However, i get the error below:
Expected element property value ‘0’ is not equal with actual property value ‘null’