Questions tagged [rest-assured-jsonpath]

For use only with the popular REST-Assured API testing framework for Java.

Path-based query syntax for JSON documents in the REST-Assured framework for API testing. Not to be confused with the JsonPath specification (http://goessner.net/articles/JsonPath/)

Docs: https://github.com/rest-assured/rest-assured/wiki/Usage#json-using-jsonpath

382 questions
0
votes
1 answer

I have created a .json file and want to fetch the data from that json file using rest assured method. How can I achieve this?

I have designed a Rest Assured Framework where I create a separate JSON file that contains all API endpoints. So, now I want to pull the data out of this JSON file using Rest Assured. How can that be achieved? Sample JSON file : { "data": [{ …
Anuj G
  • 1
  • 3
0
votes
2 answers

I have to parse JSON response, I have to fetch a child node which is under leet speak (random string which contains symbols, chars, numbers)

I have to parse the JSON response, which has a leet speak, the node which I want to extract is the child of leet speak. am not able to extract the required child form the response. Ex: following is the JSON structure. from which I want to extract…
0
votes
1 answer

Unable to get json node values

This is the json response format that I have and need to read the first node value "html". I have tried to few ways to get the value but unable to get it [ { "html": "\n \n…
0
votes
1 answer

Rest Assured Failed to parse the JSON document

I am trying to test a small rest service that I am doing to study using rest assured. I followed the advice of this guy's video: https://www.youtube.com/watch?v=yDdBOspPp_c however at the time of realizing the post is said that: failed to parse the…
Bussola
  • 59
  • 1
  • 8
0
votes
1 answer

How to put wait with a specific conditions while implementing get request in rest-assured

Once I send GET request , I am able to get 200 OK. In response body, there is a key, consider that is "field_name". Currently "field_name" value is "start".After some time, value is changes to stop. Expected O/P : want to run it till i do not get…
Parth Makwana
  • 51
  • 1
  • 9
0
votes
1 answer

Updating excel with values from rest assured json response using apache-poi

I am a newbie with Rest Assured and seek help. I have written code to read values from an excel sheet and pass them as a path params in my Rest Assured tests. And this works as expected. However after I get the json response from the post request I…
Mihir
  • 491
  • 5
  • 21
0
votes
2 answers

Want to take nested JSON data(count value) through java

{ "success": true, "data": { "count": 0, "list": [] } } I have a json data where I want to check count and print it's value First of all I am using jsonpath() function because it's rest-assured and putting response inside it ArrayList a =…
0
votes
4 answers

How to get two different fields with the same name in a Response API using Rest Assured?

I'm trying to create a Test Automation for a GET API using Rest-Assured and Java. This API has the follow response body: { "items": [ { "id": "3185", "customer_id": "299", "region": "São Paulo", …
Cleicy Guião
  • 111
  • 1
  • 20
0
votes
0 answers

error when trying to validate json schema

I am trying to validate my json response in my rest assured tests and i get the following error in my schema. not sure how to resolve this. any help will be appreciated :) thank you. error: io.restassured.module.jsv.JsonSchemaValidationException:…
0
votes
1 answer

Rest Assured: Why do I get IllegalStateException exception?

I am in the process of studying Rest-Assured framework. I am using http://ziptasticapi.com free API for my drills. When I call: final static String BASE_URI = "http://ziptasticapi.com/"; final static String ADAK_ZIP_CODE = "99546";…
dushkin
  • 1,939
  • 3
  • 37
  • 82
0
votes
1 answer

Not able to take response body data for assertions while performing operations using rest-assured with java

Following is Response body: { "Updated_Fields": [ "a", "b", "c", "d" ], "Invalid_Fields": [ "cd", "ab" ] } I want to check that whether response body has two fields in invalid_field…
0
votes
1 answer

How to search in anonymous and nested array using find or findAll in groovy's closures using REST-Assured library?

I have following JSON response anonymous body and I need to parse nested arrays dynamically to retrieve a key's value based on a condition by using find or findAll in the groovy's closures [ { "children": [ { "attr": { …
Raj
  • 31
  • 1
  • 7
0
votes
1 answer

How to validate a "null" Boolean response?

I'm developing an Api Automation test using Rest-Assured. This is my API response: { "is_active": false, "token": null } I want to assured that Token is null, so I developed the following code: public void…
Cleicy Guião
  • 111
  • 1
  • 20
0
votes
1 answer

API Orchestration in rest assured during run time

How to build a post request after taking some values from other post response on the run time in rest assured. Suppose I have a big Json file which I am going to send it as request modifying just 2 or 3 key's values taking that value from another…
K G
  • 3
  • 3
0
votes
1 answer

How can I validate a body response without a string?

I'm developing an API Automation test using rest assured. My API response is like: { "is_active": true, "token": "s4vj75pj6********" } When I send an invalid count is like: { "is_active": false, "token": "" } So I want to validate…
Cleicy Guião
  • 111
  • 1
  • 20