0

Am new to API testing and trying to validate response in 'JSON Text' format which is not having any key or property.Please find below json and let me know how can I validate this.Am reading the same format from another file and trying to validate with response JSON.

  {
"path1": true,
"path2": true,
"path3": true
}

Am using the below code to compare the response .But it is giving {} output(empty). I tried with response.getBody() , jsonPath(),but none of them worked.Please suggest!

 validateResponse(Response response, String expectedValue) {
        String value = response.asString();
            if (value.contains(expectedValue)) {
                System.out.println("Validated Successfully: " +value);
              }
    }
Rahul
  • 759
  • 3
  • 21
  • 43

0 Answers0