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
3 answers

Extract a value in a json response with a variable

I am trying to return the id of a declared variable from a json file: i want my java code to search for the previous variable in the json response and once it is found -> return the corresponding id. I am using RestAssured in java. Json file…
1
vote
1 answer

In Java Rest Assured framework is there any way to use x-www-form-urlencoded form params using POJO classes?

In Rest Assured framework we use POJO classes concept when there is a JSON payload. But right now I am having x-www-form-urlencoded form params. Is there any way we can use POJO classes for x-www-form-urlencoded form params? Please let me know the…
Wilson
  • 73
  • 8
1
vote
1 answer

How to extract a html response and parse it JSON from a GET call in REST ASSURED framework?

In Postman I have did in the below way and want to do the same in Rest Assured framework. I want to parse and save the "tltkt" value in Rest Assured framework. How can I do that in Rest Assured? GET call…
Wilson
  • 73
  • 8
1
vote
0 answers

While running jsonpath.getInt("element") ,I am facing error: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.memoize.EvictableCache.getAndPut

I am working on REST Assured Automation and using JSONPATH to get element values using jsonpath.getInt("id") but asper error logs it seemed to be Groovy Error, Unable to resolve this issue. Can anyone please pitch in. …
1
vote
0 answers

I am getting 404 error when I used the data of 1st response as input to second request both i used POST?

I send this request POST:http://localhost:8080/rest/auth/1/session and got successful response and then i took the ID from the response and used to send 2nd request POST http://localhost:8080/rest/issue then i got this 404 error with below…
Jeevan
  • 19
  • 1
1
vote
1 answer

Rest assured - Invalid JSON expression: Script1.groovy: 1: Unexpected input: '['

I'm trying to retrieve the id of the workflow having "type":"system" using JSON expression Method: public static int getSystemWorkflowId(final Map cookies) { return…
1
vote
1 answer

Child attributes also displayed for in json path while trying to get only root node

For the below sample JSON when I tried to print the root node using $: It is printing the entire JSON as a result: { "ABC,123": { "p1": 100, "s1": 66, "o1": 10, } } I need to get ABC,123 using a JSON path. I tried as $ it's…
1
vote
1 answer

Escape character formatting in graphql query

need help in formatting a graphql mutation in java code. In postman it looks like this->.postman and what I have tried is-> my code and the error I am getting is--> error I am getting. Thanks in advance :-)
Raghu K
  • 57
  • 1
  • 10
1
vote
2 answers

Hamcrest: how to find an item in an array of objects?

in RestAssured based integration tests I get the following response: { "status": "UP", "checks": [ { "name": "boot-errors", "status": "UP" }, { "name": "server-state", "status": "UP", "data":…
Seymour Glass
  • 81
  • 2
  • 15
1
vote
1 answer

How to use 'find' in restassured to search this nested array structure?

In restassured, it's possible to use JsonPath 'find' function to search for object. https://www.javadoc.io/doc/io.rest-assured/json-path/3.0.0/io/restassured/path/json/JsonPath.html An example given in the link: { "store": { "book": [ { …
user1559625
  • 2,583
  • 5
  • 37
  • 75
1
vote
1 answer

Not parsing JSON document to return access token variable - Rest Assured / Java

I have a step definition that is meant to perform a basic auth to get an access token. However I am not able to retrieve the string when it calls the authenticateWithBasicAuth method in the RestAssuredExtension class. I am getting the error…
1
vote
1 answer

JIRA Creating Bug using Rest Assured API's : AuthenticationException: Invalid Username or Password

Query : Creating Bug in JIRA portal automatically when the Test gets failed using Rest assured API(java) but the output is AuthenticationException: Invalid Username or Password but the Same Getting successful in Postman. I can able to create Bug and…
1
vote
1 answer

How to post nested json in restassured

Below is the code I am using JSONObject requestParams = new JSONObject(); requestParams.put("something", "something value"); requestParams.put("another.child", "child value"); This is how the api needs to be posted { "something":"something…
neha gupta
  • 11
  • 1
  • 2
1
vote
1 answer

Multiple examples in scenario outline gives error(Missing EOF at examples:) in eclipse IDE, How can i solve this?

Scenario Outline: Given.. When.. Then.. @test 1 Examples: | Model | Version | Fuel | | Honda | Brio | Petrol | @test 2 Examples: | Model | Version | Fuel | | …
rachita
  • 31
  • 2
1
vote
1 answer

How can i catch referer value dynamically changing in request header

I want to add referer value into my code but when i check it from network tab through inspect of Chrome, referer value is not constant, it's always changing. How can i catch and define it in my code ? Is there a way to set the referer as parameter…
santino87
  • 53
  • 6