- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 74 Articles for Postman
234 Views
We can set a Test in Postman with JavaScript method. In Postman, a test executes provided a Request is successful. This is because a test is created to include checkpoint and validate various parameters of the Response.Tests implemented in the JavaScript method are written within the Tests tab.Add the below JavaScript test −tests["Verify Response Time"] = responseTime > 600The tests is a variable of type array which can store data types- integer, string, Boolean and so on. Verify Response Time is the test name. The responseTime captures the time taken to obtain the Response.Select a GET request and enter an ... Read More
632 Views
We can run Collection Runner in Postman with the help of the below steps −Click on the Runner menu in the Postman application.The Collection Runner window gets launched.Click on the Collection name from the section – Choose a collection or folder.Choose an Environment from the Environment list box and enter the number of Iterations. Also, we can set a delay time in milliseconds.We have to select a file type from the Data field if we are utilizing data from a file. Then click on the Run Collection1 button.The Collection Runner result page gets opened. The tests get triggered as per ... Read More
991 Views
This Postman Cheat Sheet is based on the official documentation page of Postman (which is available in the below link) and from the overall knowledge on Postman −https://learning.postman.com/docs/getting-started/introduction/a. VariablesAll the variables can be set up manually from the GUI of Postman and they have a defined scope. The values of the variables can also be set with the help of scripts written under the Pre-request Script or Tests tab.The variables can be added in the request URL, Headers and Body in the format as {{}}.Usage in request URL −https://{{domain}}about/{{id}} Usage in request Headers(key-value): X-{{key}}:valueUsage in request Body −{"registration_id": "{{Id}}", "firstname": ... Read More
357 Views
We can integrate Postman with Newman and Jenkins. Newman is used to verify and execute a Collection. To integrate Newman and Jenkins, we have to follow the below steps −Step1 − We have to complete the installation and configuration of Jenkins. The steps to perform this task is discussed in details in the below link −https://www.tutorialspoint.com/jenkins/jenkins_installation.htmStep2 − We have to install npm and Nodejs. For installation of Nodejs can be done from the below link −https://nodejs.org/en/download/current/Step3 − The npm is allocated with Nodejs so once we download the Nodejs, the npm gets downloaded automatically.Step4 − We have to install Newman ... Read More
782 Views
While executing a Collection, the requests are run in the same sequence as they appear in Postman. Let us have a Collection with at least two requests. To trigger them for execution, first click on the arrow appearing to the right of the Collection name in the sidebar. Then click on Run.Collection Runner pop-up comes up. The RUN ORDER section shows the order in which the requests shall get executed from top to the bottom. (GET->POST->DEL->PUT). Click on the Run Collection1 button.Execution Results show the GET request executed first, followed by POST, then DEL finally PUT, as specified in the ... Read More
334 Views
We can set Tests using the Functional method in Postman. A test in Postman gets executed only if a Request is successful. In case a Response does not get generated, the test does not to validate it.Tests implemented in the Functional method are written within the Tests tab.Add the following verification using the Functional method within the Tests tab −pm.test["Status Code is 401"], function(){ pm.response.to.have.status(401) })Here, pm.test is the function. Status Code is 401 is the test name which shall be displayed in the Test Result tab after execution. The pm.response is used for getting the Response ... Read More
683 Views
We can set multiple Tests for a Request in Postman with JavaScript method. A Test in Postman gets executed only if a Request is successful. In case a Response does not get generated, a test does not to validate it.Tests implemented in the JavaScript method are written within the Tests tab.Add the following JavaScript verifications within the Tests tab −tests["Status Code should be 200"] = responseCode.code === 200 tests["Response time lesser than 10ms"] = responseTime
611 Views
There are different parameters available in Newman. Newman's command to list down all options is − newman run –h. Options in Newman is grouped into categories listed below −UtilityBasic setupRequest optionsOther Misc. OptionsUtility-h, --help – displays usage information.-v, --version - displays version number.Basic Setup--folder [name of folder] – points to a folder in Collection for execution.-e, --environment [name of file| URL] - points to an Environment in the form of JSON file.-d, --iteration-data [file] – mentions a data file to utilize either csv or json.-n, --iteration-count [number] – specifies the count of iterations to.Request Options--delay-request [number] – configures delay in ... Read More
989 Views
We can use the Selenium webdriver JavaScript Executor to navigate to a URL. Selenium can run JavaScript commands by using the executeScript method.The parameters to be passed to the executeScript method to navigate to a URL is - window.location = \'"+s+"\'. Here, s is the variable which stores the link of the page to navigate.SyntaxJavascriptExecutor js = (JavascriptExecutor) driver; String s = "https://www.tutorialspoint.com/about/about_careers.htm"; String scrpt = "window.location = \'"+s+"\'"; js.executeScript(scrpt);Code Implementationimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.JavascriptExecutor; public class LnkJSNavigate{ public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java \chromedriver.exe"); ... Read More
250 Views
We can run webdriver in headless mode. This is achieved with the HTMLUnitDriver which is the fastest webdriver among all the other browser drivers.Post Selenium 2.53 version, the HTMLUnitDriver jar should be added explicitly in the project. To add the required dependency, the below steps need to be followed −Navigate to − https://github.com/SeleniumHQ/htmlunit-driver/releases.Click on the jar marked in the below image.Right-click on the project and choose the option Build path. Then click on Configure Build Path.Click on Java Build Path and select the Libraries tab. Click on the Add External JARs button. Then add the downloaded HTMLUnitDriver jar. Finally, click ... Read More