Postman Series (10) - Import and Export (Collections, Environment, Global Variables)

 Postman can export or import data. Data that supports this function include collections, environments, and global variables.

1. Export data

1. Export interface collection

Click the ··· button for the interface collection you want to export and select Export.

After selecting the export directory, click OK. The interface collection will be saved locally in the format of a json file.

The saved file stores all the information of the current collection in the form of json.

2. Export global variables

Select the "Environments" tab of postman, select "Globals", and click the "Export" button.

After selecting the export directory, save. All global variables of the current workspace will be saved locally in the format of a json file.

Global variable data in json file:

3. Export global variables

Select the "Environments" tab of postman, select an environment to be exported, click the "···" button in the upper right corner, and then select the "Export" button.

After selecting the export directory, save. All environment variables in the current environment will be saved locally in the format of a json file.

Environment variable data in json file:

2. Import data

The entrance to importing files is relatively simple, click import in file or click import next to the name of the work area.

After clicking the entry, the import box will pop up.

You can choose to import files one by one, or you can choose to import files in a folder.

Single file import:

Import folder:

If the imported data already exists in postman:

1. The interface collection already has a collection with the same name: In this case, a pop-up will pop up to choose to overwrite (Raplace) or choose to import as a copy (Import as Copy)

Selecting overwrite will overwrite the original collection. If you select as a copy, the name of the imported interface collection will be added with "copy" and then imported into postman.

Import as a copy:

2. A global variable with the same name already exists: the imported data will overwrite the "initial value" of the local global variable, and the "current value" remains unchanged. Because when exported, global variables will only export their initial values.

Modify the values ​​and then import them into postman:

Imported data overwrites the "initial value" of local global variables:

3. An environment with the same name already exists: postman allows an environment with the same name to exist, so this situation is not affected.

 Postman series article directory:

Zero-Based Entry Interface Function Testing Tutorial-Table of Contents_Bad Poet_Ww’s Blog-CSDN Blog


The sample files used in the postman series of articles have been uploaded to my official account [Essential Skills for Software Testing]

If necessary, you can click on the article to download the QR code and go to get it~

Guess you like

Origin blog.csdn.net/weixin_40883833/article/details/126532413