Member-only story

Generating JMeter Scripts for API testing using Swagger/OpenAPI Specification file

Asanka Vithanage
3 min readMay 6, 2020

--

As performance engineers, We spend half of our life writing performance scripts. If we can figure out a way to generate scripts than writing them that will be a lifesaver.

In this article, I am trying to explain how we can generate JMeter scripts for API testing using a Swagger/OpenAPI Specification API documentation.

I got the following copied from https://swagger.io/docs/specification/about/ which explains what is Swagger/OpenAPI Specification.

OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. An OpenAPI file allows you to describe your entire API,

API specifications can be written in YAML or JSON. The format is easy to learn and readable to both humans and machines.

Nowadays It's a common practice to use OpenAPI Specification to define the API contract. API development teams consider API contracts as their main requirement document and product documentation. So every API team will have an OpenAPI/Swagger specification.

Swagger provides a set of open-source tools built around the OpenAPI Specification that can help you design, build, document, and consume REST APIs.

Out of them,

Swagger Codegen provides the ability to generate server stubs and client libraries from an OpenAPI spec.

--

--

Asanka Vithanage
Asanka Vithanage

Written by Asanka Vithanage

Software Quality Assurance Professional, Problem Solver, SOA Tester, Automation Engineer, CI/CD Practitioner, DevOps enthusiast

Responses (1)