All Projects → k6io → Postman To K6

k6io / Postman To K6

Licence: apache-2.0
Converts Postman collections to k6 script code

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Postman To K6

postman-to-k6
Converts Postman collections to k6 script code
Stars: ✭ 269 (+49.44%)
Mutual labels:  load-testing, postman, performance-testing, postman-collection
Gin Boilerplate
The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQL database and JWT authentication middleware stored in Redis
Stars: ✭ 559 (+210.56%)
Mutual labels:  postman, postman-collection
Postman Code Generators
Common repository for all code generators shipped with Postman
Stars: ✭ 526 (+192.22%)
Mutual labels:  postman, postman-collection
Restdocs To Postman
Converts Spring REST Docs cURL snippets to Postman and Insomnia collections
Stars: ✭ 39 (-78.33%)
Mutual labels:  postman, postman-collection
Awesome Jmeter
A collection of resources covering different aspects of JMeter usage.
Stars: ✭ 413 (+129.44%)
Mutual labels:  performance-testing, load-testing
Metersphere
MeterSphere 是一站式开源持续测试平台,覆盖测试管理、接口测试、性能测试等。搞测试,就选 MeterSphere!
Stars: ✭ 6,331 (+3417.22%)
Mutual labels:  postman, performance-testing
Pmtoapib
Tool to convert Postman collection exports to Api Blueprint documentation
Stars: ✭ 34 (-81.11%)
Mutual labels:  postman, postman-collection
Performance Testing Framework
Framework allows to perform load testing with Apache Jmeter, view application/server metrics in real-time with Grafana, analyze errors cause with detailed traces for failed requests, compare different test runs in scripted dashboard and perform frontend performance testing with sitespeed.io+webpagetest
Stars: ✭ 275 (+52.78%)
Mutual labels:  performance-testing, load-testing
Swaggman
OpenAPI Spec SDK and Converter for OpenAPI 3.0 and 2.0 Specs to Postman 2.0 Collections. Example RingCentral spec included.
Stars: ✭ 94 (-47.78%)
Mutual labels:  postman, postman-collection
Covid 19 Apis
Postman COVID-19 API Resource Center—API collections to help in the COVID-19 fight.
Stars: ✭ 111 (-38.33%)
Mutual labels:  postman, postman-collection
Gatling Dubbo
A gatling plugin for running load tests on Apache Dubbo(https://github.com/apache/incubator-dubbo) and other java ecosystem.
Stars: ✭ 131 (-27.22%)
Mutual labels:  performance-testing, load-testing
Jmeter Maven Plugin
The JMeter Maven Plugin
Stars: ✭ 362 (+101.11%)
Mutual labels:  performance-testing, load-testing
Nbomber
Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
Stars: ✭ 354 (+96.67%)
Mutual labels:  performance-testing, load-testing
Awesome Test Automation
A curated list of awesome test automation frameworks, tools, libraries, and software for different programming languages. Sponsored by http://sdclabs.com
Stars: ✭ 4,712 (+2517.78%)
Mutual labels:  performance-testing, load-testing
Locust
Scalable user load testing tool written in Python
Stars: ✭ 17,763 (+9768.33%)
Mutual labels:  performance-testing, load-testing
Newman
Newman is a command-line collection runner for Postman
Stars: ✭ 5,607 (+3015%)
Mutual labels:  postman, postman-collection
Hargo
Hargo is a Go library and command line utility that parses HAR files, can convert to curl format, and serve as a load test driver.
Stars: ✭ 164 (-8.89%)
Mutual labels:  performance-testing, load-testing
k6-template-typescript
Template to use TypeScript with k6
Stars: ✭ 90 (-50%)
Mutual labels:  load-testing, performance-testing
Pewpew
Flexible HTTP command line stress tester for websites and web services
Stars: ✭ 269 (+49.44%)
Mutual labels:  performance-testing, load-testing
Awesome K6
A curated list of resources on automated load- and performance testing using k6 🗻
Stars: ✭ 78 (-56.67%)
Mutual labels:  performance-testing, load-testing

postman-to-k6-cover

Postman-to-k6

Converts a Postman collection to a k6 script.

CircleCI branch npm npm dockerhub



Content

Features

  • Prerequest scripts.
  • Test scripts.
  • Variables (at all scopes + dynamic).
  • Data files.
  • Authentication methods (except Hawk).
  • File uploads.
  • postman.* interface (exceptions below).
  • pm.* interface (exceptions below).
  • Global variables exposed by Postman: globals environment data iteration.
  • xml2Json conversion.
  • All Postman Schema versions.

Installation

Local Installation (recommended)

While possible to install globally, we recommend that you, if possible, add the converter to the node_modules of your test project using:

$ npm install -D postman-to-k6

# or using yarn...

$ yarn add postman-to-k6

Note that this will require you to run the converter with npx postman-to-k6 your-postman-file or, if you are using an older versions of npm, ./node_modules/.bin/postman-to-k6 your-postman-file.

Global Installation

$ npm install -g postman-to-k6

Docker

The tool is also available for usage in Docker. To download an image with the tool from DockerHub:

$ docker pull loadimpact/postman-to-k6

Usage

To convert an exported collection to a k6 script:

$ postman-to-k6 collection.json -o k6-script.js

Then run the script in k6, as usual, using:

$ k6 run k6-script.js

Options

Iterations

Configures how many times the script will be executed before completion.

Flag Verbose Default
-i --iterations 1

Example:

$ postman-to-k6 collection.json --iterations 25 -o k6-script.js

Environment Variables

Provide environment variables from a JSON file.

Flag Verbose Default
-e --environment N/A

Example:

$ postman-to-k6 collection.json --environment environment.json -o k6-script.js

Global Variables

Provide global variables from a JSON file.

Flag Verbose Default
-g --global N/A
$ postman-to-k6 collection.json --global globals.json -o k6-script.js

CSV Data File

Provide a data file in the CSV format.

Flag Verbose Default
-c --csv N/A
$ postman-to-k6 collection.json --csv data.csv -o k6-script.js

JSON Data File

Pass in a data file in the JSON format.

Flag Verbose Default
-j --json N/A
$ postman-to-k6 collection.json --json data.json -o k6-script.js

Separate

Split requests into separate files, for easier rearrangement of the logic.

Flag Verbose Default
-s --separate false
$ postman-to-k6 collection.json --separate -o k6-script.js
postman-to-k6 collection.json -s -o k6-script.js

Skip Pre

Skips any pre-request scripts during conversion

Flag Verbose Default
--skip-pre false
$ postman-to-k6 collection.json --skip-pre -o k6-script.js

Skip Post

Skips any post-request scripts during conversion

Flag Verbose Default
--skip-post false
$ postman-to-k6 collection.json --skip-pre -o k6-script.js

Docker Usage

Using the Docker image, you execute the tool as follows:

$ docker run -it \
    -v "/path/to/postman/collection/:/postman/" \
    loadimpact/postman-to-k6 \
    /postman/my-collection.json \
    -o /postman/test.js

and then execute the k6 test using:

$ k6 run /path/to/postman/collection/test.js

Examples

A collection of Postman examples are located under example. To run one of the examples, just run it as you would any other command:

$ postman-to-k6 example/v2/echo.json -o k6-script.js

Unsupported Features

  • Sending requests from scripts using pm.sendRequest.
  • Controlling request execution order using postman.setNextRequest.
  • Cookie properties, like hostOnly, session, and storeId.
  • Textual response messages:
    • responseCode.name
    • responseCode.detail
    • pm.response.reason
    • pm.response.to.have.status(reason)
    • pm.response.to.not.have.status(reason)
  • Properties returning Postman classes:
    • pm.request.url pm.request.headers
    • pm.response.headers
  • The Hawk authentication method.
  • Deprecated xmlToJson method.
  • Request IDs are changed. Postman doesn't provide them in the export so we have to generate new ones.

Other similar tools

Credits

Thanks to bookmoons for creating this tool. Also, thanks to borjacampina for creating the original incarnation of the tool.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].