Skip to main content

postman2runner

Convert postman data to JSON testcases for HttpRunner.

usage

To see postman2runner version:

$ python main.py -V

To see available options, run

$ python main.py -h
usage: main.py [-h] [-V] [--log-level LOG_LEVEL]
               [postman_testset_file] [-- output_dir] [-- output_file_type]

Convert postman testcases to JSON testcases for HttpRunner.

positional arguments:
  postman_testset_file  Specify postman testset file.
  -- output_dir   Optional. Specify converted JSON testset folder.
  -- output_file_type  Optional. Generate file format , default json.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show version
  --log-level LOG_LEVEL Specify logging level, default is INFO.

examples

In most cases, you can run postman2runner like this:

$ python3 main.py tests/data/test.json --output_dir tests/postman2case --output_file_type yaml
INFO:root:Generate JSON testset successfully: output.json

As you see, the first parameter is postman source file path, and the second is converted JSON file path.

The output testset file type is detemined by the suffix of your specified file.

If you only specify postman source file path, the output testset is in JSON format by default and located in the same folder with source file.

$ python3 main.py tests/data/test.json
INFO:root:Generate JSON testset successfully: test/test.output.json

generated testset

generated JSON testset output.json shows like this:

[
    {
        "test": {
            "name": "/api/v1/Account/Login",
            "request": {
                "method": "POST",
                "url": "https://httprunner.top/api/v1/Account/Login",
                "headers": {
                    "Content-Type": "application/json"
                },
                "json": {
                    "UserName": "test001",
                    "Pwd": "123",
                    "VerCode": ""
                }
            },
            "validate": []
        }
    }
]

参考来源

【HttpRunner】

Release files for postman2runner 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for postman2runner 0.0.2
File Size Uploaded
postman2runner-0.0.2.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for postman2runner 0.0.2
File Interpreter ABI Platform
postman2runner-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / postman2runner-0.0.2.tar.gz

Download URL postman2runner-0.0.2.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5ef26e4c53e5cb0ef3de2284ae801530048dbb80ad60084789b7a7e32dc00253
BLAKE2b-256 checksum
How to use checksums
c0117b102b861017fc2f52b72e612773a5a16343bac3f6de44a57d9daab6af21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / postman2runner-0.0.2-py3-none-any.whl

Download URL postman2runner-0.0.2-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
599e014bd5c9878a11a892bd6109b0d099c9fdec8389cb91e0dc3c2019154ef7
BLAKE2b-256 checksum
How to use checksums
5b390a10b1e6781a7011bebc0edbe06571a89191473de6e88b6cfa107257bb28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page