NOTE: This utility is based on the work of sercheo87.
This tool convert projects Postman to JMeter
npm i postman-jmeter -g
$ postman-jmeter
Usage: convert-postman-jmeter -p [file] -j [file] [-o] [-b] [-v=resolve|transform]
-help |
Show help | boolean |
||
--version |
Show version | boolean |
||
-p, --postman |
Path of postman collection file to process | file |
required |
|
-j, --jmeter |
Path of JMeter test plan (.jmx) | file |
required |
|
-e, --environment |
Path of postman environment file | string |
optional |
|
-o, --overwrite |
Overwrite existing .jmx file | boolean |
optional |
|
-v, --variables |
Variable resolution strategy | string |
required |
transform , resolve |
-b, --batch |
Process all collection files (*.postman_collection.json ) in directory |
boolean |
optional |
|
-k, --postmanAPIKey |
Postman API Key. Consider using an environment variable locally and a secret in your CI/CD system | string |
required |
|
-w, --workspaceID |
UID for workspace to report test results back to. Only useful in CI/CD context | string |
optional |
Postman collection and environment variables are added to the JMeter Test Plan as User Defined Variables. What appears in the value
column in the User Defined Variables pane and other parts of the JMeter UI depends on the variable resolution strategy.
How to handle variables defined at the collection and environment level.
resolve
: Resolve postman variables into their actual values in the JMX test plan. Replace references to variables with their actual variables elsewhere, eg in the protocol, Server Name or IP, and/or Path fields:
transform
: Resolve values in the User Defined Variables pane, but use JMeter replacement syntax elsewhere.
resolve
is the default strategy.
This utility is designed to enable load-testing via JMeter as part of a CI/CD pipeline. An example can be found in this repo.
NOTE: Protocol is always resolved, even if inferred from variable values.
If desired, test results in the form of a screenshot of the JMeter HTML report can be sent back to a workspace in Postman. See t ./github/workflows/load-testing-image.yml
for an example.
Body data are not currently processed.
For issues create o find in issues page.