1

I am using a json request and as part of negative testing, I am making it as invalid as below. I have removed the comma at the end of plancode line and I am expecting this request to go to server and show the error response from server.The problem is it is giving me syntax error in Karate as

net.minidev.json.parser.ParseException: Unexpected token "

It is working fine through SOAP UI. Need help here !

def user =

{
"requesterID": "test1",
"clientTraceLevel": 4,
"application": "ABC",
"planCode": "newcode"
"planEffDate":"12/3/2018",
"status": "b"
}
dota2pro
  • 7,220
  • 7
  • 44
  • 79
Rishim
  • 53
  • 4

1 Answers1

1

You can use the text data type:

* text user =
"""
{
"requesterID": "test1",
"clientTraceLevel": 4,
"application": "ABC",
"planCode": "newcode"
"planEffDate":"12/3/2018",
"status": "b"
}
"""

Note that you may need to force the right Content-Type header in this case, please read the docs on how to do so.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248