Testing REST IPA using POSTMAN

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
JavaScript & jQuery the missing manual Chapter 11
Dropbox is a tool the CSME will set up for its participants upon request so that participants do not have to upload podcasts to CSME servers via FTP (file.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
AQS Web Quick Reference Guide Changing Raw Data Values Using Maintenance 1. From Main Menu, click Maintenance, Sample Values, Raw Data 2. Enter monitor.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Bonrix SMPP Client. Index Introduction Software and Hardware Requirements Architecture Set Up Installation HTTP API Features Screen-shots.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Website Development with PHP and MySQL Saving Data.
Chapter 6 Server-side Programming: Java Servlets
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Introduction to JavaScript CS101 Introduction to Computing.
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
1 © Donald F. Ferguson, All rights reserved.Modern Internet Service Oriented Application Development – Lecture 2: REST Details and Patterns Some.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
RESTful Web Services What is RESTful?
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
EUDAT receives funding from the European Union's Horizon 2020 programme - DG CONNECT e-Infrastructures. Contract No B 2 DROP User.
PHP Form Processing * referenced from
Downloading and Installing GRASP-AF Workshop Ian Robson Information Analyst, North of England Cardiovascular Network.
National College of Science & Information Technology.
Data and tools on the Web have been exposed in a RESTful manner. Taverna provides a custom processor for accessing such services.
1 Terminal Management System Usage Overview Document Version 1.1.
AdisInsight User Guide July 2015
Fundamental of Databases
Development Environment
Tiny http client and server
The Client-Server Model
API (Application Program Interface)
Content from Python Docs.
About Dropbox Dropbox is a tool the CSME will set up for its participants upon request so that participants do not have to upload podcasts to CSME servers.
CISC103 Web Development Basics: Web site:
Node.js Express Web Applications
CARA 3.10 Major New Features
z/Ware 2.0 Technical Overview
Section 13 - Integrating with Third Party Tools
How to Write Web Forms By Mimi Opkins.
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Data Virtualization Community Edition
Data Virtualization Tutorial… CORS and CIS
Node.js Express Web Services
Hypertext Transport Protocol
Next Generation SSIS Tasks and data Connection Series
PHP / MySQL Introduction
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
Intro to PHP & Variables
Boeing Supply Chain Platform (BSCP) Detailed Training
CCA Skill Certification
CISC103 Web Development Basics: Web site:
Topic 5: Communication and the Internet
WEB API.
(Includes setup) FAQ ON DOCUMENTS (Includes setup)
Client side & Server side scripting
MAX Warranty Tracking Vince Stefanetti, Exact MAX Americas Trainer.
JavaScript & jQuery AJAX.
CSc 337 Lecture 1: post.
PHP Forms and Databases.
(Includes setup) FAQ ON DOCUMENTS (Includes setup)
Lab 2: Information Retrieval
CSc 337 Lecture 18: post.
[Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU]
Presentation transcript:

Testing REST IPA using POSTMAN Postman is a powerful HTTP client for testing web services. Created by Abhinav Asthana, a programmer and designer based in Bangalore, India, Postman makes it easy to test, develop and document APIs by allowing users to quickly put together both simple and complex HTTP requests. Postman is available as a native app for Mac, Windows, and Linux operating systems.

Installing the Postman app To install Postman, go to the https://www.getpostman.com/apps Click Download for Mac / Windows / Linux depending on your platform. macOS installation Once you’ve downloaded app, you can drag the file to the “Applications” folder. Double click on Postman to open the application. Windows installation Download the setup file Run the installer

Navigating Postman Postman provides a multi-window and multi-tab interface for you to work on APIs. This interface design gives you as much space as possible for your APIs.

Requests In Workspaces, you can create any kind of HTTP request. The four parts of an HTTP request are the URL, method, headers, and the body.

Responses The Postman response viewer helps to ensure the correctness of API responses. An API response consists of the body, headers, and the status code.

How does this work? 1. Enter your request details (URL: postman-echo.com/get) in Postman, and hit the Send button. 2. The request is received by the API server (postman-echo.com), and it returns a response. 3. The response is received by Postman, and the response is visualized in the interface.

CONSIDERATIONS OF TESTING WEB SERVICE A well-constructed API test suite answers questions such as: Does the service respond quickly enough for the intended users? Will the server respond with the correct values?(Positive Testing) How will the service handle exceptions and illegal values?(Negative Testing) Is the service stable under expected and unexpected user loads?(JMETER,LoadRunner)

Example of testing IPA of newbook API documentation for newbook: http://newbookalliance.github.io/API/ Base URL: https://stage-api.newbookmodels.com

Policies for all calls Clients should add following headers to all requests: X-Newbook-Client: '<client>' X-Newbook-Version: '<version>' API supports content negotiation Via Accept header: Accept: application/json Authorization API uses token-based authorization via Authorization header: authorization: '<token>‘ API Versioning API uses url-path versioning. That means, you have to add version prefix (e.g. /api/v1/) to each API url.

GET list of cities [GET /cities/]

GET with parameters A Get request can pass parameters to the server using "Query String Parameters". For example, in the following request, https://stage-api.newbookmodels.com/api/v1/cities/?name=Miami the parameter “name" has the value “Miami".

Test scripts With Postman you can write and run tests for each request using the JavaScript language. A Postman test is essentially JavaScript code executed after the request is sent, allowing access to the pm.response object.

Test results Postman runs tests every time you run a request. Results are displayed in a Tests tab under the response viewer. The tab header shows how many tests passed, and the test results are listed here. If the test evaluates to true, the test passed.

Signin [POST /auth/signin/] The HTTP POST request method is meant to transfer data to a server (and elicit a response). What data is returned depends on the implementation of the server. To send POST request we need: URL: https://stage-api.newbookmodels.com/api/v1/auth/signin/ Body: example of request body provided in documentation { "email": "a@a.aa", "password": "qwer1234" }

POST request structure Choose POST method URL is https://stage-api.newbookmodels.com/api/v1/auth/signin/ Go to “Body” tab to configure body 4 and 5 configure content-type. 6. Body in json format

Response The response returns us "token" (unique key) for clients account. In all clients requests(Permissions: IsClient), we have to assign token to the header.

Get self data [GET /client/self/] URL: https://stage-api.newbookmodels.com/api/v1/client/self/ For authorization will use token generated from Signin request.

Request structure URL: https://stage-api.newbookmodels.com/api/v1/client/self/ For authorization will use token generated from Signin request. Response return information about client account

Update self user data [PATCH /client/self/] URL: https://stage-api.newbookmodels.com/api/v1/client/self/ For authorization will use token generated from Signin request.

Request structure URL: https://stage-api.newbookmodels.com/api/v1/client/self/ For authorization will use token generated from Signin request.

Response

Variables Variables allow you to reuse values in multiple places so you can keep your code DRY (Don’t Repeat Yourself).   Also, if you want to change the value, you can change the variable once with the impact cascading through the rest of your code. Variables can be used in the following form in the Postman user interface -  {{variableName}} . The string {{variableName}} will be replaced with its corresponding value when Postman resolves the variable. For example, for an environment variable url with the value http://localhost , you will have to use  {{url}}  in the request URL field. 

Add variables

Add variables In the table we providing variable name and value. After that click save and close the window.

Use variables Variables inside the Postman UI are enclosed inside curly braces.

Links for more information https://www.getpostman.com/docs/v6/ https://docs.postman-echo.com/

TYPES OF HTTP REQUESTS GET – Retrieves the data from a specified source POST- Sends new data to a specified source PATCH- Updates info for a specified source DELETE- Removes data from a specified source

HTTP STATUS CODE 1XX- Codes between 100-199 mean that the server is working on the request. Not so common 2XX- Codes between 200-299 mean that the request was successful. 3XX- Codes between 300-399 mean that the request was not performed. 4XX- Codes between 400-499 mean that the request is incomplete and may need more info 5XX- Codes between 500-599 mean that the server encountered an error.