Getting org.json.jsonexception expected a ' ' when trying to record JSON transactions in VSE recorder

book

Article ID: 105897

calendar_today

Updated On:

Products

CA Application Test Service Virtualization CA Continuous Application Insight (PathFinder) CA Service Virtualization (DevTest / LISA / VSE / Application Test)

Issue/Introduction

Getting the below error while recording JSON transactions in the VSE recorder. 

org.json.JSONException: Expected a ':' after a key at 989 [character 11 line 47] at org.json.JSONTokener.syntaxError(JSONTokener.java:433) at org.json.JSONObject.(JSONObject.java:212) at org.json.JSONTokener.nextValue(JSONTokener.java:363) at org.json.JSONObject.(JSONObject.java:205) at org.json.JSONTokener.nextValue(JSONTokener.java:363) at org.json.JSONObject.(JSONObject.java:214) at org.json.JSONTokener.nextValue(JSONTokener.java:363) at org.json.JSONArray.(JSONArray.java:115) at org.json.JSONTokener.nextValue(JSONTokener.java:366) at org.json.JSONObject.(JSONObject.java:214) at org.json.JSONTokener.nextValue(JSONTokener.java:363) at org.json.JSONObject.(JSONObject.java:214) at org.json.JSONObject.(JSONObject.java:321)

Cause

Some of the Requests  had invalid Json characters and the VSE recorder could not parse the request.

Environment

All supported DevTest environments

Resolution

Fixed the JSON errors in the application and then re-recorded. 

Additional Information

Use any JSON validator available online to validate the Requests.