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
1
vote
2 answers

RestAssured Outh login isuue to Twitter

I am trying to collect most recent tweets from Twitter account, I Learning Rest Assured. I try to authenticate and get latest Tweets. below is my code. public void login() { Acess_Token="8043781991*************"; …
balaji
  • 31
  • 4
1
vote
2 answers

RestAssured JsonPath: Issue with getting list from json

Can someone who familiar with jsonPath give me an advice how can i get a list of title from each item0, item1, item2 etc. This query will return findAll {it.key.startsWith('item')} List of maps where key is item and value is body of item object…
Roman
  • 91
  • 1
  • 10
1
vote
1 answer

Rest assured path not able to access element with number in path

In the following (partial)JSON response: { "costPrices": { "3226186": [ { "fromDate": 1420066800000, "toDate": null, "product": { I'm trying to access the value of fromDate like this:…
sjottil
  • 43
  • 6
1
vote
0 answers

rest-assured jsonPath returns HashMap instead of LinkedHashMap

This pertains to Java. I would like to be able to change the default behavior of how a JsonPath object returns itself when parsed from a json response so that I can still leverage the methods it comes with such as getMap(), getList(), etc. Ideally I…
1
vote
1 answer

REST-assured | How to get list of values based on matching critera using JSONpath

I am trying fetch the list of values based on the criteria using JSON path REST-assured. Following is my JSON response and I want to fetch the values for credentialId where credentialType" is "Ban User Name", I tried the below code however its…
Raghav
  • 21
  • 1
  • 3
1
vote
1 answer

How to use JsonPath to get first attribute in a structure

I have the following json structure: some_map_like_object: { "key_1": { }, "key_2": { }, "key_3" { } } Note that the some_map_like_object is not a collection. Is there a way to use restassured jsonpath (with gpath) to get…
Marcel Overdijk
  • 11,041
  • 17
  • 71
  • 110
1
vote
2 answers

How to get a List from restassured JsonPath

I am using restassured framework, and inside it, it has JsonPath class. JsonPath has a method signature of getList(String path, Class T); I have attempt to do something like this: List myList = myJsonPathObject.getList("mypath",…
Churk
  • 4,556
  • 5
  • 22
  • 37
0
votes
0 answers

How to validate and compare the database records using RestAssured Automation Cucumber(Feature file)

How to validate and compare the database records using RestAssured Automation Cucumber-Feature file by using parameterization. I want the tableName, columns and condition to be passed through the feature file and parameterize it. Is there a better…
0
votes
0 answers

How to read url's, payload,headers from postman exported collection in rest assured

I want to read the urls, headers, payload of collection of api's that are exported from postman collection and want to run in rest assured I have tried to add json file to the project and call that file with name in the rest assured code but that…
0
votes
0 answers

I am running java runner calss and this throwing this exception error and all things were configured

Please tell me what should I do to remove this issue java.lang.AbstractMethodError: Receiver class io.cucumber.junit.JUnitCucumberOptionsProvider$JunitCucumberOptions does not define or inherit an implementation of the resolved method 'abstract…
0
votes
1 answer

Don't want to include certain values in Payload in Rest Assured

I am using Rest Assured framework where I dont want to use certrain varaibles that I have declared in the POJO. package pojo; import java.util.List; public class DispositionStatus { private String name; private String code; private…
ayush
  • 3
  • 1
0
votes
1 answer

How to add two different objects in array list to rest API request using Rest Assured?

I want to add payload like this: { "data": [ { "name": "saumy", "code": "say1y" }, { "name": "saumy", "code": "say1y" } ], "dispositionList": "11379" } I…
ayush
  • 3
  • 1
0
votes
0 answers

How to search into JSON using REST assured GPath

I have following JSON { "resourceType": "Parameters", "parameter": [ { "name": "result", "valueBoolean": true }, { "name": "message", "valueString": "Matches found" }, { "name": "match", "part": [ { "name": "equivalence", "valueCode":…
fsa1803
  • 1
  • 1
0
votes
1 answer

convert complex json array to pojo java class

Below is the Expected JSON { "checkIn": "2023-06-03", "checkOut": "2023-06-04", "roomsInfo": [ { "adultsCount": 2, "kidsAges": [] } ], "searchInfo": null, "crossSellDetail":…
0
votes
0 answers

Comma inside a Json Array( Getting this value , set a value using the json path)

"Message": { "Heading": { "ABC": { "sample": [ "465783", "647837" ], } }, I have this json sample to read and update…