We have scenario where there is GET API call which extracts "excel" file data from file given file location in the GET call Body.
Using: RestAssured with Cucumber BDD
The Response comes as:
"{\"('Test\/Test1', 'Text')\":{\"0\":\"abc\",\"1\":null,},\"('Test ID', 'Text')\":....:null}}"
Trying to have "Assert" to the text value coming in the Response body.
Tried below ways:
String details = response.jsonPath().get("Test\/Test1");
System.out.println("loan details value is: " + details);
Getting error as:
io.restassured.path.json.exception.JsonPathException: Failed to parse the JSON document
at io.restassured.path.json.JsonPath$ExceptionCatcher.invoke(JsonPath.java:986)
at io.restassured.path.json.JsonPath$4.doParseWith(JsonPath.java:951)
at io.restassured.path.json.JsonPath$JsonParser.parseWith(JsonPath.java:1031)
at io.restassured.path.json.JsonPath.get(JsonPath.java:202)
at com.xxx.stepdefinition.Co_APIs_StepDen.extract_validated_successfully(Core_APIs_StepDen.java:62)
at ?.Validate the extracted details are retrieved successfully(C:/Users//src/test/java/com/Co_POST_ExtractDetails.feature:17)
Caused by: groovy.json.JsonException: A JSON payload should start with an openning curly brace '{' or an openning square bracket '['. Instead, '"{"('Test/Test1', 'Text')":
Please guide.