We usually use Apache JMeter for load testing and measure performance but the issue is that JMeter is not a real browser
...RECENT BLOG

2020 / 2 / 27

2020 / 2 / 27

2020 / 2 / 27

2020 / 2 / 27

2020 / 2 / 27
Postman is currently one of the most famous tools for API Testing. This tool is very popular if you need to dissect the RESTful API made by others or if you want to test an API you have made yourself.
But what do we exactly mean by an API? API means Application Programming Interface which helps software applications to interact with each other via API Calls.
Postman began as a side project to simplify the workflow of an API during testing and development.
After reading this short introduction you must be wondering why Postman is so popular among the crowd.
There are various reasons for the popularity. Let’s begin by discussing reasons first, then we will go to Step by Step installation guide of Postman.
Using Postman just needs you to log-in to your account and here you go. You can access all your files anytime, anywhere. All you need is a postman desktop application.
Postman helps to organize test suites by allowing collection creation for API calls. Each collection can create multiple requests and subfolders.
It is possible to create, export, import collections. Thus, making it easier to share files. Collections can be shared via direct link.
Having multiple environments aid in less repetition of tests as the same collection can be used but for a different environment.
Test Checkpoints can be added to each API call, thus ensuring test coverage.
Using Collection Runner or Newman helps in automating testing where tests can run in multiple iterations, saving time for repetitive tasks.
Postman is able to support Continuous Integration.
After having such a detailed discussion, You must now a bit convinced that Postman is not a bad choice. In Fact, it deserves to be in the top 5 list.
Let’s quickly start discussing steps to install and download Postman. So, that we can start working on it.
Postman is an open-source tool.
Steps to Install Postman
Once downloaded, run the executable file.
How to Use Postman
If you clearly observe the screenshot below, you will see that the workspace itself is a puzzle with so many pieces. In order to solve this, you need to have a basic knowledge of the basic pieces. Let’s start discussing a few of the important components of the workspace.
How to execute various HTTP requests in Postman
Working with GET Request.
Working with POST Requests.
Parameterization of Requests.
How to Create Postman Tests.
How to Create Collections in Postman.
How to run collections using Runner and Newman.
Working with GET Requests: GET Requests are used to retrieve information from the specified URL.
We will be using the following URL in our examples:
https://jsonplaceholder.typicode.com/users
Steps to execute GET Request:
a. In the workspace, set HTTP Request to GET Request type.
b. In the request URL field, input the URL -
https://jsonplaceholder.typicode.com/users
c. Click the Send button.
d. On successful completion of the GET REquest, you will see 200 OK Messages. It might be possible that GET Request failed to execute. Reasons can be two- one the requested URL is invalid or authentication is needed.
NOTE: There is no data manipulation at the endpoint in the case of GET Requests. The user just queries a page. User is not allowed to send data to manipulate the page.
1. Click on the + sign to create a new request.
2. Select the HTTP request type to POST Request.
3. Input URL as previous example: https://jsonplaceholder.typicode.com/users.
4. Switch to the Body Tab. Here we will type the code with correct curly braces to add a new user.
5. Click raw and then select JSON.
6. Copy and paste complete details of one user from the output of the previous example. NOTE: change the id of the user to 11. You can also change other details also. But changing id is mandatory.
[
{
"id": 11,
"name": "Rashi Garg",
"username": "RashiG",
"email": "rashi_garg185@gmail.com",
"address": {
"street": "APHB Colony, Andhra Pradesh Housing Board Phase-IV, ",
"suite": "A-77",
"city": "Hyderabad",
"zipcode": "500032",
"geo": {
"lat": "17.440081",
"lng": "78.348915"
}
},
"phone": "9899787777",
"website": "wwww.frugaltesting.com",
"company": {
"name": "FrugalTesting",
"catchPhrase": "On Demand Performance Testing",
"bs": "Cloud Based Load Testing Solution"
}
}
]
NOTE: The POST Request should have the correct format. Please check the format of the JSON request. You can use tools like this.
7. Click the send button.
8. Status 201: Created shows the success of POST Request.
9. The POST data is shown in the body.
3. Parameterization of Requests: Parameterization of Request is one of the most important feature of Postman. Variables with parameters can be used instead of using the same request with different data. The data can be from a data file or an environment variable. Parameterization helps to the repetition of the test.
Let’s have a look at the example. Parameters are created using curly braces {{Parameters}}
a. Set HTTP Request Type to GET Request.
b. Input URL: {{url}}/users in the text box Enter the URL.
c. Click the send button
NOTE: There will be no response as we have not set the source of the parameter.
4. In order to use the parameter, you need to set the environment. Click on the eye icon.
5. Click edit and set the variable to the global variable in order to make it accessible in all collections.
6. In the variable set the name of the URL as https://jsonplaceholder.typicode.com
7. Click the Save button.
8. Click Close if you see the next screen.
9. Go back to the GET Request screen and click the Send button. This time you will be able to see the results.
NOTE: Please ensure that parameters have a source like a destination file or an environment variable.
How to create Postman Test
Postman Tests are Javascript codes added to the requests to verify the results such as successful or failed status etc. /it can be compared to assert and verify command in other tools.
Switch to Tests tab. On the right side are snippet codes.
From the snippets section, click on the “Status code: Code is 200”. You will observe that the pane is auto-populated.
Now click the send button. You will see the test results.
Let’s generate another test. Go to the test tab.
From the snippets section. Click on “Response body: JSON value check”. We will be checking if Ervin Howell has user id 2.
2020 / 2 / 27
2020 / 2 / 27
2020 / 2 / 27
2020 / 2 / 27
2020 / 2 / 27
Can Selenium be used for Testing ?