Questions tagged [rest-assured]

REST Assured is a Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs.

REST Assured enables testing of REST services in Java.

It uses a fluid syntax inspired by similar libraries for and .

2207 questions
0
votes
0 answers

RestAssured Not able to extract response

I am trying to get the id_token.basic value but its not working because of .basic { "user_id": "12345", "id_tokens": [ { "id_token.basic": "myid123" } ] } Tried the below, but because of .basic its not…
Sam1977
  • 15
  • 4
0
votes
1 answer

Expected and actual matching but test is failing

Using rest-assured to invoke a base rest service with: given().get(baseUrl + "/base/") .then() .statusCode(200) .body("size()", is(2)) .body("meanPerDay", equalTo(1.5)) returns…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
0
votes
0 answers

How to bypass or disable SSl handshake error

I am using a Post request of restAssuredApi having body in XML format. RestAssured.baseURI = basetUrl; RequestSpecification request = RestAssured.given(); response = request.headers(headers()).body(getXMLasString(XmlPath)) …
user13920392
0
votes
1 answer

Eclipse doesn't show suggestions to import package for RestAssured project. How to fix this?

I am using Eclipse Version: 2019-06 (4.12.0). For my Rest Assured project, I have downloaded and added the JAR files from the path https://github.com/rest-assured/rest-assured/wiki/Downloads. For the keyword "RestAssured" Eclipse should suggest to…
0
votes
0 answers

How to parameterize XML using RestAssured Java

${id} ${name} 2011-12-05T00:00:00+05:30 95 I have this above…
Lucifer
  • 9
  • 2
0
votes
1 answer

Using RestAssured, I am getting a partial response. not sure what exactly am I missing

Request being sent: '''@Test public void firstPost() { RestAssured.baseURI = "https://reqres.in/"; JSONObject reqBody = new JSONObject(); reqBody.put("name", "Ajay"); reqBody.put("job", "leader"); RequestSpecification reqSpec…
0
votes
1 answer

I want to assert "Total" from the response in RestAssured can someone suggest me how to do that

Headers: Authorization=Bearer4796aea4838ce5487518c706d49cc847b57e4196b52f0921539697e2d44bf060Accept=*/*Cookies: Multiparts: Body: 200{ "code": 200, "meta": { "pagination": { "total": 1526, "pages": 77, "page": 5, "limit": 20 } }
0
votes
1 answer

Share Test Context in Cucumber,while creating object in java to share same state for all scenarios i am getting exception

Share Test Context in Cucumber,while creating object in java to share same state for all scenarios i am getting exception here i am creating object of endpoints class from TestContext class Failure Trace java.lang.IllegalStateException: Cannot stop.…
0
votes
2 answers

Uploading Mutliple file using REST-assured

I need to upload multiple files using REST-assured, a Java DSL for easy testing of REST services. I succeeded to upload a single file. But I am not able to upload mutliple files. Can someone help me to upload multiple files in one request? Example…
Sai
  • 389
  • 6
  • 18
0
votes
1 answer

How can we do Parallel Execution of API Test Cases(GET/POST) using Rest Assured based Framework

Please find the below base class for API request. Due to static request/response, I am not able to do parallel test execution. My framework is based on Cucumber, Junit, Java, Json based request. public class APIreq { private static Integer…
0
votes
1 answer

Cannot deserialize out of start_array token

This is my method for POST test public void createParagraph3() { RestAssured.baseURI = paragraphsURL; Map map = new HashMap(); map.put("featurePackage", Arrays.asList(new HashMap() {{ …
0
votes
0 answers

Rest assured test failing java.lang.AssertionError: 1 expectation failed. XML path fixtureId doesn't match

I'm getting an error in my test I've found the end point but I'm getting a null actual response I don't know why. I'm asking my data provider to provide me with the responses I'd like. I get null back. I'm not sure why. My second test the fixture id…
0
votes
1 answer

Data provider mismatch TestNG using RestAssured

I've been playing about with RestAssured and started using data providers for data driven tests. I'm currently getting a data provider mismatch error. I'm assuming it will be because im passing in a string or perhaps my api endpoint is incorrect?…
0
votes
1 answer

How to generate array object from pojo and pass in formparams in Java

I need to generate key as customerContactList[0].customerContactId from Pojo. I have tried with arrayList but I am able to generate in below format customerContactList=[{ customerContactId=2 } ] which seems invalid for API request. this Post API…
0
votes
1 answer

In Rest Assured, arrange the order of payload

I have written code for Rest Assured API to automate, I've created the payload using JSONObject but the payload is not ordered because of which I am getting an error. Below is how my payload should look like { "Student": "Primary", "class":…
Vipin Singh
  • 109
  • 1
  • 14
1 2 3
99
100