0

To extract status form this response in rest assured i just need to use one.response or two.response

{
"one": {
    "status": "SUCCESSFUL",
    "fileNum": "1"
},
"two": {
    "status": "SUCCESSFUL",
    "fileNum": "2"
}}

But how can I extract the same value (without changing key) if i have such response:

{
"something.one.txt": {
    "status": "SUCCESSFUL",
    "fileNum": "1"
},
"somethinganother.two.txt": {
    "status": "SUCCESSFUL",
    "fileNum": "2"
}}
VSs
  • 61
  • 4

1 Answers1

0

You need to escape the key:

response.jsonPath().getString("'something.one.txt'.status") // Will return "SUCCESSFUL"
Johan
  • 37,479
  • 32
  • 149
  • 237