Testing RESTful Web APIs

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

REST Vs. SOAP.
ARINs RESTful Provisioning Interface Tim Christensen.
Microsoft SharePoint 2010 technology for Developers
HP Quality Center Overview.
Snejina Lazarova Senior QA Engineer, Team Lead CRMTeam Dimo Mitev Senior QA Engineer, Team Lead SystemIntegrationTeam Telerik QA Academy SOAP-based Web.
T Sponsors Sameer Chabungbam Principal Program Manager, Microsoft Connector API Apps BizTalk Summit 2015 – London ExCeL London | April 13th & 14th.
Peoplesoft: Building and Consuming Web Services
Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Integrating Complementary Tools with PopMedNet TM 27 July 2015 Rich Schaaf
Struts 2.0 an Overview ( )
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Classroom User Training June 29, 2005 Presented by:
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
AIRNow Web Services Data to Go! Prepared by Steven A. Ludewig, Timothy S. Dye Sonoma Technology, Inc. Petaluma, CA John E. White U.S. Environmental Protection.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
CSCI 6962: Server-side Design and Programming Web Services.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
Web Services based e-Commerce System Sandy Liu Jodrey School of Computer Science Acadia University July, 2002.
Nadir Saghar, Tony Pan, Ashish Sharma REST for Data Services.
SOAP-based Web Services Telerik Software Academy Software Quality Assurance.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
REST By: Vishwanath Vineet.
The Mechanics of HTTP Requests and Responses and network connections.
PTC Navigate & Thingworx based App Development
Architecture Review 10/11/2004
Integrating ArcSight with Enterprise Ticketing Systems
Integration with External Applications: General View
Integrating ArcSight with Enterprise Ticketing Systems
Business Directory REST API
The Client-Server Model
API (Application Program Interface)
Creating a Basic Form Module
Warranty Status API Overview
Better RESTFul API – Best Practices
PLM, Document and Workflow Management
Web Development Web Servers.
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Section 13 - Integrating with Third Party Tools
Why API?.
Understanding SOAP and REST calls The types of web service requests
WEB SERVICES.
Data Virtualization Community Edition
Data Virtualization Tutorial… OAuth Example using Google Sheets
Designing For Testability
Node.js Express Web Services
Unit – 5 JAVA Web Services
API Documentation Guidelines
Automated Automation of REST APIs
Testing REST IPA using POSTMAN
WEB API.
Lecture 1: Multi-tier Architecture Overview
Appcelerator Arrow: Build APIs in Minutes. Connect to Any Data Source
$, $$, $$$ API testing Edition
API DOCUMENTATION Swetha Mohandas Microsoft Connect 2016
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
What’s new in ASP.NET Core and Entity Framework 2.2 (Preview 3)
Integration (API) testing with SoapUI
ARCHITECTURE OVERVIEW
Building production-ready APIs with ASP.NET Core 2.2
Chapter 42 Web Services.
Python and REST Kevin Hibma.
Remedy Integration Strategy Leverage the power of the industry’s leading service management solution via open APIs February 2018.
WCF Data Services and Silverlight
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

Testing RESTful Web APIs Prepared by Antanas Bareikis 2017-12-20

Contents Overview Swagger Assertible Demo Sources 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Overview REST stands for Representational State Transfer. It is a software architecture style that relies on a stateless communications protocol, most commonly, HTTP. REST structures data in XML, YAML, or any other format that is machine-readable, but usually JSON is most widely used. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Swagger “Swagger is a simple yet powerful representation of your RESTful API. (...) With a Swagger-enabled API, you get interactive documentation, client SDK generation and discoverability.” - swagger.io Swagger is a formal specification surrounded by a large ecosystem of tools, which includes everything from front-end user interfaces, low-level code libraries and commercial API management solutions. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Swagger UI Swagger UI is an open source tool which automaticaly generates a web page from swagger specification. Allows developers or end consumers to visualize and interact with the API‘s resources without having any of the implementation logic in place. Swagger UI  is an open source tool which generates a web page. This web page documents the Restful APIs generated by Swagger specification. This UI presentation of APIs is user friendly, easy to understand with all the complexity of business logic kept behind the screen. This is a great tool for developers, testers and end consumers, to understand the end points. It also allows you to manually test these APIs from this web page. Please see below the sample screenshot of how the UI looks. Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from your Swagger specification 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Swagger UI 2017-12-20 VU, Matematikos ir Informatikos fakultetas This UI presentation of APIs is user friendly, easy to understand with all the complexity of business logic kept behind the screen. This is a great tool for developers, testers and end consumers, to understand the end points. It also allows you to manually test these APIs from this web page. The Swagger UI is automatically generated from any API defined in the Swagger specification, and can be viewed within a browser. Swagger UI can be used as is provided by Swagger. Or we can make changes as per the needs and make our own build. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Testing the APIs manualy Access through: http://<host>:<port>/swagger/ Swagger UI provides a rich user friendly interface with all the details of API. These details include the request parameters with its type (path, query, body, etc.), its data type (string, array[string], HttpSession, schema of body type parameter, etc.) and whether it’s a mandatory parameter or not. These details also include the response type (application/json, etc.) and schema of response body. Since we have already configured the Swagger UI into our project, let’s go to the below URL and have a look. In the UI, we can see all the controllers listed. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Testing the APIs manualy (2) Once you click on one of those controllers, you will get to see a list of all the APIs implemented in that controller with its URL like this. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Testing the APIs manualy (3) Clicking it will show us the details of that API along with the fields to enter values for request parameters. If API has default value for any of the parameter, the field will come preset with the value. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Testing the APIs manualy (4) Hit Try it out to make a request to that API. The response of this request can be checked to match the expectation from an API. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Swagger UI Extensions API Fortress Restlet Client Rest Secured Assertible Swagger test templates 1. It is an automated testing platform that monitors the performance of APIs, validates the accuracy of the entire payload, and provides real-time insights without any coding. You get a listing of all the available API endpoints. Choose an API you want to test, and it creates a test for you. You can modify the test as per your need and publish. You can run a test manually, or schedule it to run autonomously, and get notified of issues as soon as they happen. The test will generate a detailed report where execution is captured in steps. These details makes the analysis much easier to find the cause of failure when needed. 2. Restlet Client (known as DHC earlier) enables you to interact with REST services. This client improves the user experience, saves time to debug the REST calls & sharing of requests with others is made convenient. Swagger can be used as an extension for this client. When integrated, it provides Swagger document in JSON format. Swagger UI also provides its support to Restlet APIs, makes it easy to interact and test the APIs. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Demo 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Conclusions Using auto-generated Swagger UI makes manual testing of API quicker and easier. It‘s possible to use various extensions for swagger UI like Assertable which provide automated testing and monitoring capabilities. 2017-12-20 VU, Matematikos ir Informatikos fakultetas

Sources https://www.soapui.org/rest-testing/getting-started.html http://wmpratt.com/swagger-and-asp-net-web-api-part-1/ https://assertible.com/blog/testing-an-api-using-swagger https://www.xoriant.com/blog/product-engineering/testing-rest-apis-swagger.html 2017-12-20 VU, Matematikos ir Informatikos fakultetas