Debomita Bhattacharjee has Published 867 Articles

How to get the response time of a request in Rest Assured?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Nov-2021 10:57:35

5K+ Views

We can get the response time of a request in Rest Assured. The time elapsed after a request is sent to the server and then receiving the response is known as the response time.The response time is obtained in milliseconds by default. However, we can also obtain in other time ... Read More

Explain PUT request in Rest Assured.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 18-Nov-2021 10:54:16

2K+ Views

A PUT request is used to pass data to the server for the creation or modification of a resource. The difference between POST and PUT is that POST request is not idempotent.This means invoking the same PUT request numerous times will always yield the same output. But invoking the same ... Read More

What is XmlPath in Rest Assured?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:36:30

3K+ Views

We can find all XML nodes with Rest Assured using the XMLPath. If the response is in XML format, we need to use the methods under the XMLPath. If the value of the node is an integer, we have to use the method getInt.If the value of the node is ... Read More

Explain DELETE request in Rest Assured.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:28:54

2K+ Views

We can execute the DELETE requests in Rest Assured. This is done with the help of the http DELETE method. It is responsible for deleting a server resource.Delete request can have a request or response body. The status codes available for a DELETE request are listed below −200 (OK)204 (if ... Read More

Validate JSON Schema in Rest Assured.

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:24:34

11K+ Views

We can validate JSON schema in Rest Assured. The schema validation ensures that the Response obtained from a request satisfies a set of pre-built rules and the JSON body in the Response has a specific format.We shall use the method matchesJsonSchema (part of the JSONSchemaValidator class) for verifying the schema. ... Read More

How to Add Cucumber Layer on Top of REST-assured API Tests?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:12:48

249 Views

We can add the Cucumber layer on top of Rest Assured API tests. This can be done by following the below steps:Step 1 − Create a Maven project. The details on how to create a Maven project is discussed in detail in the below link −https://www.tutorialspoint.com/maven/index.htmStep 2 − Add the ... Read More

How to handle responses in text format in Rest Assured?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:09:42

2K+ Views

We can handle responses in text format in Rest Assured. For this, we need to configure Rest Assured such that it can grasp a plain/text type Response. We need to use the registerParser method which is a part of the RestAssured class. Then pass text/plain and Parser.Text as parameters to ... Read More

How to handle static JSON in Rest Assured?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:04:39

4K+ Views

We can handle static JSON in Rest Assured. This can be done by storing the entire JSON request in an external file. First, the contents of the file should be converted to String.Then we should read the file content and convert it to Byte data type. Once the entire data ... Read More

How to use TestNG data providers for parameterization in Rest Assured?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 13:00:26

886 Views

We can use TestNG data providers for parameterization in Rest Assured. Using data providers we can execute a single test case in multiple runs. To know more about TestNG data providers visit the below link −https://www.tutorialspoint.com/testng/testng_parameterized_test.htmThis technique can be used for dynamic payloads. For this, we shall create a Java ... Read More

How to get JSON fields(nodes) based on conditions using Rest Assured?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 17-Nov-2021 12:52:07

2K+ Views

We can get JSON fields(nodes) based on conditions using Rest Assured. First, we shall obtain a Response body which is in JSON format from a request. Then convert it to string.This is done with the help of the JSONPath class. To parse a JSON response, we have to first convert ... Read More

Advertisements