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

What is the Java library to remove/modify a json object based on json path, or how to fix the below issue in JsonPath?

I am trying to implement a function to be able to remove or modify a json object base on a specified json path. For example, if I have a below json string/object: { "PersonalDetailsDTO": { "FirstName": "Mark", "LastName": "Sully", …
user1559625
  • 2,583
  • 5
  • 37
  • 75
0
votes
1 answer

What went wrong on RestAssured API call

I am using following code to create issue on Jira which is hosted on my local machine. But i am getting error code 400. I am not able to find out what went wrong and things are working perfectley fine when making the API call from post man. I am…
0
votes
2 answers

RestAssured - Compare two JSON Objects

Using RestAssured I am trying to compare two JSON Objects. Example : The first JSON is from excel I read it as a String and store it String a = "Some JSON from Excel and I store it as a String"; The second JSON is a response that returns a Response…
Melvin Richard
  • 403
  • 1
  • 7
  • 15
0
votes
1 answer

Convert Curl to Restassured

I have a cURL that takes a file checksum and xml along with multiple headers in order to upload an image to a server. Im not very familiar with RestAssured so my question is; How do i represent the -F cURL values in RestAssured? `curl -s -w "\nHTTP…
Eamon M
  • 55
  • 2
  • 9
0
votes
2 answers

How to set root if the response has two arrays in rest assured

My API's response is something like this: JSON "Catalog": [ { "longDescription": "some long description", "Price": [ { "priceValue": "60.0", } ], "name": "some…
0
votes
1 answer

Validating empty values in a response json. Provided a JsonArray with keys that need to be validated

I have Response json like below { "orderId": "16057421778", "displayOrderId": "160574217786", "numberOfItems": 2, "items": [ { "orderItemId": "3291379", "item": { "itemId": "10127763", "definingAttrs": null, …
coder
  • 1
0
votes
3 answers

How can I read the name value pairs using key names from a JSON Response

I am using the com.jayway.restassured.response.Response class to read the response from the API. Its in the following format. Is there a way I can access the value of layout or regions using the keyname. For example - response.layout or…
0
votes
1 answer

Dependecy between two different json files in restassured

I have Created two java classes TestA.java,TestB.java using restAssured where each of the class reads json from TestA.json and testB.json and post a request to endpoint uri.TestA.java returns a json response having tag "customerID" which will be…
0
votes
3 answers

How to Post the below request using RestAssured in selenium

How to POST the below request using RestAssured in selenium. The request is as follows: { "ShipmentID": "", "ShipmentNumber": "123455-6", "Comments": "", "LineIDs": [ { "ShipmentDID": "", "AssetNum": "759585", "FileC": "", …
0
votes
1 answer

Rest Assured - Json Extract

I am receiving response in the following structure: [{ "builds": [{ "description": "JP MORGAN", "land": "FU", "companyCode": "1234", "accountNumber": "00000000000", "shortID4": "XYS" …
Michal
  • 610
  • 10
  • 24
0
votes
1 answer

Use JSONAssert on part of JSON with RESTAssured

I am able to retrieve JSON from a service using RESTAssured. I would like to use the JSONPath capability to extract JSON and then compare it using JSONAssert. Here's my example: @Test public void doAPITestExample() throws JSONException { //…
0
votes
1 answer

Order mismatch from RestAssured Response object to JSON conversion

I got a Rest Assured Response object. While trying to convert from Response object to JSON. The conversation happen successfully but JSON order is mismatch. It would be great if some one assist on this. Conversion: JSONObject jobj = new…
0
votes
1 answer

API Automation : Assertion is not working for google place api

//Below mentioned code not working for assertion in google api import io.restassured.RestAssured; import io.restassured.http.ContentType; import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.equalTo; public class Base…
0
votes
1 answer

How to read nodes in JSONArray using Rest Assured IO JSONPath?

Below is the response of a REST request and my requirement is to verify if name node contains "Military" and amount node equals 500 [ { "incentiveId":11791331, "autoApplied":null, "name":"Toyota US Lease Loyalty -…
Srinivasan Ramu
  • 1,033
  • 4
  • 11
  • 23
0
votes
0 answers

I am not able to get a list of id from the below json with the help of RestAssured JsonPath

I am not able to get a list of id from the below json with the help of RestAssured JsonPath. { "Test": [ { "id": "657" }, { "id": "2711" } ], "Test2": [ { "id":…
Aakash Pahuja
  • 469
  • 4
  • 10