All Questions
51 questions
0
votes
1
answer
45
views
Authorization token is not working in Rest Assured
package com.automation.tests;
import static io.restassured.RestAssured.*;
import org.json.JSONObject;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;...
0
votes
0
answers
295
views
REST Assured Test Failing due to "NoSuchMethodError"
I am trying to generate Auth0 Access Token by sending a POST request in Rest-Assured TestNG framework. The Content Type that I need to pass in request body is "application/x-www-form-urlencoded&...
3
votes
1
answer
485
views
How to use query parameter with different combination in rest assured in Java?
I have 6 query parameters. All of them are optional.
How should I use them with all combinations?
I tried the following:
do {
Response searchbyfield = given()
.headers("Cookie", ...
0
votes
1
answer
668
views
Unable to pass raw JSON request body with response error "The browser (or proxy) sent a request that this server could not understand"
I am trying to make a GET request to the URI which has header Content-Type=application/json and has a request body which is a raw JSON type.
Below is the code I am using with RestAssured API but it ...
0
votes
1
answer
546
views
Getting 407 Authorization error while executing RestAssured code after providing custom proxy details
I'm new to API testing using Rest Assured.
As I'm working behind the proxy, I have used all the proxy details in the code. Below is the code I'm trying to execute. Getting 407 error.
...
0
votes
1
answer
2k
views
How can I turn ON "Automatically follow redirect" in Rest Assured/Java
I'm stuck on this issue, please help...
So, Post request working fine on Postman, but in Rest Assured I am getting 307 Temporary Redirect status code. I find that this issue related to redirects. ...
0
votes
0
answers
162
views
How to apply sorting on a time stamp field in Rest Assured Java
I've an API response which is sorted via the field provided in the payload. The API response body has a lot of parameters out of which the field on which it is sorted is a date-time field. How can I ...
0
votes
0
answers
261
views
How to get the response of an intermediate API call?
I am currently trying developing some API tests using rest-assured. More specifically, I am trying to test Stripe's payment gateway (3DS). The way it works is that I subscribe a user using our API ...
2
votes
1
answer
473
views
Convert class to parameters map in REST Assured
I have the following class:
data class Person(
val name: String,
val surname: String,
val age: Int
}
and I want to do this:
val person = Person("John", "Locke", 66)
...
0
votes
1
answer
339
views
TestNG/RestAssured : Is there any way we can reuse @Test methods in different classes?
I am a newbie to automation. I am using Rest-Assured. And I want to validate response for every request like for example checking if response is null or status code, status line, content-type etc .
Is ...
1
vote
1
answer
818
views
How to ignore properties during verification with custom object in rest-assured
I need to validate the entire JSON response against an expected JsonObject from org.json.simple package while ignoring some additional properties from the response
JSONObject jsonObject = new ...
0
votes
1
answer
4k
views
If you need dependency injection, put cucumber-picocontainer on the classpath
Keep getting this error and I am now at my wits end, can anyone explain what I may be doing wrong please - apparently might have to do with cucumber versions, how does one make the versions match:
io....
0
votes
1
answer
699
views
How to assert that a property in body has only a few predefined values
Json body:
{
"result": [
{
"object": {
"type": "mattress"
}
},
{
"object": {
"type": "...
0
votes
1
answer
1k
views
How to check if list returned by Json path contains only 1 unique value
Json response:
{
"result": [
{
"object": {
"id": "myId"
}
},
{
"object": {
"id": "myId&...
0
votes
1
answer
470
views
Cannot validate email values in restapi using restassured
can someone please assist, I'm using restassured to pull and display results from this server https://jsonplaceholder.typicode.com/posts/9/comments, but cannot verify the emails of this user and ...