郵便配達の簡単な例

https://blog.csdn.net/zsj777/article/details/102456224、無料のAPIを探します

1、無料のAPIを見つけるために、天気予報を取得

http://t.weather.sojson.com/api/weather/city/101220101

 

2は、要求を取得し、変数を設定して事前にリクエストスクリプト

http:// {{variable_key}} / API /天気/都市/ 101200101

事前にリクエストスクリプト

console.log( '1111')

postman.clearEnvironmentVariable( "variable_key");

postman.setEnvironmentVariable( "variable_key"、 "t.weather.sojson.com");

 

3、アサーション、テスト中のどの

テスト[ "ボディ文字列にマッチする"] = responseBody.has( "武汉")。

 

アサーション成功

 

おすすめ

転載: www.cnblogs.com/mobies/p/11804664.html