cerberustesting / cerberus-core

The Open Source Test Automation Platform.
https://cerberus-testing.com
GNU General Public License v3.0
329 stars 100 forks source link

[LR] JSON Service response cannot handle null values #2459

Open ittaLaRedoute opened 1 year ago

ittaLaRedoute commented 1 year ago

For JSON service response, if we have a null value, Cerberus cannot find the element. For example, if we have the following response:

{
  "status": "success",
  "data": null,
  "message": "Successfully! Record has been fetched."
}

Cerberus cannot get the value for $.data: image Currently, the only way to bypass this error is to find all elements $..data and it will return the value in an array: image

Test case implemented for debug on online version: https://prod.cerberus-testing.com/TestCaseScript.jsp?test=ITTA&testcase=0004A

It works fine for number, string and true/false values. Tested in Cerberus version 4.16 and 4.17