Member-only story

How to set user environment variables for test?

胡家維 Hu Kenneth
2 min readFeb 23, 2020

--

Postman is a common tool we use when developing APIs. Not only are developers testing it for themselves, but also collections can store several test scenarios and share them with others in the team, which greatly improves the efficiency of API integration.

Postman 是我們在開發 api 時的常用工具,不僅是開發者自行測試好用,還有 collection 可以儲存數個測試情境,分享給團隊其他人使用,大幅提高 api 整合的效率。

SCENARIO 情境說明

  1. Each environment is different, so the URL is different but the method name and parameters are the same 測試每個環境都是不同, 所以URL是不同的但是方法名稱與參數是相同的
  2. The parameters may be different in different environments測試的參數在不同環境也可能不同

Manage Environments

  1. Click “cog” icon 點選“齒輪”圖示

2. There are three ways to create variable- Global, Import and Add. I choose Add. 有三種創建變量的方法-Global, ImportAdd. 我選擇Add

3. define Environment name and variable for localhost. 為本地主機定義環境名稱和變量.

--

--

胡家維 Hu Kenneth
胡家維 Hu Kenneth

Written by 胡家維 Hu Kenneth

撰寫任何事情,O型水瓶混魔羯,咖啡愛好者,Full stack/blockchain Web3 developer,Founder of Blockchain&Dapps meetup ,Udemy teacher。 My Linktree: https://linktr.ee/kennethhutw

No responses yet