---
title: "Test Case Writing Guidelines and Examples - Postman"
language: "en"
url: "https://docs.testany.io/en/docs/test-case-writing-guidelines-and-examples-postman/"
markdown_url: "https://docs.testany.io/en/docs/test-case-writing-guidelines-and-examples-postman.md"
translation: "https://docs.testany.io/zh/docs/test-case-writing-guidelines-and-examples-postman.md"
last_updated: "2026-04-21T15:45:20+08:00"
---

# Test Case Writing Guidelines and Examples - Postman

Postman is an API platform for building and using APIs. This document shows how to writing a Postman test case in Testany.

[Video](https://customer-en3hmhs3okg5hi37.cloudflarestream.com/40c1ee5f62c3d27382bbce915d249905/watch)

*Note: The voice in this video is AI-generated, not original.*

**Test case package - one zip file**

Currently we only support uploading your local zip file to Testany. The zip file should follow this structure:

```
my-postman-test.zip
└── collection.json      ← Postman collection file (required, only ONE .json allowed)
```

**Registration settings:**
- **Executor:** `Postman`
- **Path:** `collection.json`


> **Info**
>
> Postman executor only supports a **single** .json collection file. If you need environment variables, configure them in the **Environment Variables** section on the test case detail page.


The zip file needs to contain at least one file:

1. **Test case code file**, like `hello-postman.postman_collection.json`
   hello-postman.postman\_collection.json

   ```json
   {
   	"info": {
   		"_postman_id": "2c19e161-6009-4237-8643-9c6df5b0c596",
   		"name": "hello-postman",
   		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
   		"_exporter_id": "549544"
   	},
   	"item": [
   		{
   			"name": "website-active-check",
   			"event": [
   				{
   					"listen": "test",
   					"script": {
   						"exec": [
   							"pm.test(\"Status code is 200\", function(){",
   							"   pm.response.to.have.status(200);",
   							"})"
   						],
   						"type": "text/javascript"
   					}
   				}
   			],
   			"request": {
   				"method": "GET",
   				"header": [],
   				"url": {
   					"raw": "{{URL}}",
   					"host": [
   						"{{URL}}"
   					]
   				}
   			},
   			"response": []
   		}
   	]
   }
   ```


> **Tip**
>
> **Environment Variables Configuration**
>
> The Postman variables used in your collection (e.g., `{{URL}}`) must be configured in **both** places:
> 1. **Test Case detail page** → **Environment Variables** section: Define `URL` and its value (e.g., `https://api.example.com`)
> 2. **Postman collection**: Use `{{URL}}` syntax to reference the variable
>
> Testany automatically passes Environment Variables to Postman during execution. See [Managing Test Case](https://docs.testany.io/en/docs/managing-test-case.md) for details.


zip all the related files as one zip file, in this case the test case package file is
[postman-test.zip](../../../__attachments/24576100/postman-test.zip?inst-v=07864bc4-715d-4f60-b8f8-0d2f7bf42d59)

![](https://docs.testany.io/docs/images/en/image-20230903-094209_8290ad66.png)

After you've successfully prepared the `.zip` file, you will be able to go to register your test case on Testany Platform. Please refer to [<Managing Test Case>](https://docs.testany.io/en/docs/managing-test-case.md) for the registration step-by-step guide.

×

## Glossary terms on this page

- [Test Case](https://docs.testany.io/en/docs/glossary.md#test-case)
- [Executor](https://docs.testany.io/en/docs/glossary.md#executor)
- [Path](https://docs.testany.io/en/docs/glossary.md#path)
- [Environment](https://docs.testany.io/en/docs/glossary.md#environment)
