1

New to rest assured. I have a rest API JSON response like below, and I'd like to extract value of "value", how can I do it?

{
    "google.com": {
        "company": google,
        "state": "CA",
        "value": 123456789
    }
}

I have tried with below code:

extract().
    body().jsonPath().get("google.com")

got below exception

java.lang.IllegalArgumentException: Cannot get property 'com' on null object

then i realized "." is used to separate json path, also tried get("/google.com")

Script1.groovy: 1: unexpected char: 0xFFFF @ line 1
Q.W.
  • 122
  • 1
  • 10

0 Answers0