Found 73 Articles for REST API

What is Rest Assured?

Debomita Bhattacharjee
Updated on 08-Feb-2022 10:07:35
Rest Assured is used to verify the REST APIs with the help of the Java library. Java library acts like a headless client to act upon the Rest web services. The libraries based on the Rest Assured library are also capable of validating the HTTP responses from the server.Response status code, body, message, headers, and so on can be tested with the Rest Assured library. It can be integrated with build tools like Maven, unit test frameworks like JUnit and TestNG. It has an efficient matching mechanism with which we can verify the expected results.Application Programming Interface or API acts ... Read More

How to create a PUT request in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:56:56
A Postman 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 POST request numerous times will create a similar resource more than one time.Before creating a PUT request, we shall first send a GET request to the server on an endpoint: applying the GET method, the Response body obtained is −Now, let us update the employee_salary and employee_age for id ... Read More

How to parameterize requests in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:46:04
We can parameterize Postman requests to execute the same request with various sets of data. This is done with the help of variables along with parameters. A parameter is a part of the URL used to pass more information to the server.The data can be used in the form of a data file or an Environment variable. Parameterization is an important feature of Postman and helps to eliminate redundant tests. Parameters are enclosed in double curly braces {{parameter}}.Let us take an example of an URL: We shall create a variable as URL then use it for parameterization of the request. ... Read More

How to create sessions in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:41:59
A session is a temporary fold that stores values of variables. They are used for the present instance and have a local scope. In Postman, we can modify the session variable value to share workspace among teams.Postman gives the feature of local session share. Even if a Collection can be shared among teams, the sessions are never shared. Different tokens have to be generated while a task is to be carried out in a team structure.A session has a local scope for a user within his Workspace and any modifications he makes shall not be reflected in the server. In ... Read More

Test and Collection Runner in Postman

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:38:03
We can have checkpoints to verify the Response from a request. This is done by adding scripts in the Tests tab. These scripts get executed if the request has executed successfully.The scripts added under the Tests tab are developed in JavaScript. After a request has been sent and a Response is received, the outcome of these test scripts are reflected in the Test Results tab in the Response. The passed tests are marked ingreen and the failed tests are in red.Input the below tests in the Tests tab −tests["Status Code should be 200"] = responseCode.code === 200 tests["Response time lesser ... Read More

Disadvantages of Monitors in Postman

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:34:35
Though Monitors in Postman have many features, it has some disadvantages as well. However, it is up to the end user if he should consider these features as drawbacks for Monitors.Disadvantages of monitors are listed below −Postman Monitors are non-functional provided the Postman server resides in the same server where we are. Thus it makes it difficult to determine the performance of a Collection in a different network.To solve this problem, we need to buy the Postman pro-version. On doing so, the Postman shall then give us another IP address with which we would be able to execute Monitors.Postman Monitors ... Read More

Analyzing Monitor Results in Postman

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:32:11
Once a scheduled Collection Monitor gets triggered, we have to analyze the results. Click on the Monitor name available under the Monitors tab.A new window opens in the browser that shall redirect to the Postman account that we are signed in.If we analyze the performance graph of the API in the above image, we see the red bars which depict tests have failed for the request. A green bar points to the fact that tests have passed. On hovering on a particular bar, we shall get date, time, Response time and the percentage of test result for a particular run.Also, ... Read More

What are Postman Monitors?

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:29:38
Postman Monitors are used to ensure that the performance and the Response obtained from an API are being maintained properly. Monitors are scheduled on a regular interval of minutes, hours or weeks for the entire day.The steps to create a Postman Monitor are listed below −Step 1 − Click on the arrow symbol to the right of the Collection name. Then click on the Monitors tab.Step 2 − Click on the Create a Monitor button.Please Note −  we have to Sign in to a Postman account in order to create a Monitor.Step 3 − Provide an input to the Monitor ... Read More

Assertions in Postman with Chai Assertion Library

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:22:17
There are Assertions in Postman with Chai Assertion Library. Assertions are used to check whether the expected and actual results are the same. If not, an Assertion error is thrown with an error message.An Assertion returns a Boolean value. In Postman, Assertion is implemented in JavaScript. It is available in the Postman application automatically.In Postman, the Assertions are incorporated under the Tests or Pre-Request Script tab. The documentation of the Chai library is available in the link − us build an Assertion to verify if the text – Postman is present in an array.   pm.test["Text is present"], function(){   ... Read More

Run Postman Collection on Jenkins

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:13:45
We can run Postman Collection on Jenkins. Firstly, we have to install Newman. To trigger an execution, we shall create a Collection having a minimum one request.The below steps list down the steps to run Postman Collection on Jenkins.Step 1 − Click on the arrow beside the Collection name in the sidebar and then click on Share.Step 2 − The SHARE COLLECTION1 dialogue box shall open. Click on the Get public link tab followed by copying the link which is highlighted in the below image.Please note -This link is not universal and applied to a specific user.Step 3 − Once ... Read More
1 2 3 4 5 ... 8 Next