2016-07-13 50 views
1

我有一個運行郵遞員,而不是紐曼的集合。集合運行在郵差,而不是在紐曼 - 無效的URI錯誤

這是錯誤 - 紐曼-c Products.postman_collection.json -e Products.postman_environment.json

Iteration 1 of 1 
RequestError: [d395a91e-4220-4c2c-81bd-cff20cac63b8] 'Product Detail' terminated. Complete error: 
Error: Invalid URI "http:///%7B%7BbaseUrl%7D%7D/shop/%7B%7BapiVer%7D%7D/products/samsung-ypk3?client_id=%7B%7BclientId%7D%7D" 
    at Request.init (/usr/local/lib/node_modules/newman/node_modules/request/request.js:288:31) 
    at new Request (/usr/local/lib/node_modules/newman/node_modules/request/request.js:142:8) 
    at request (/usr/local/lib/node_modules/newman/node_modules/request/index.js:55:10) 
    at Object.jsface.Class._execute (/usr/local/lib/node_modules/newman/src/runners/RequestRunner.js:181:26) 
    at Timeout._onTimeout (/usr/local/lib/node_modules/newman/src/runners/RequestRunner.js:87:20) 
    at tryOnTimeout (timers.js:224:11) 
    at Timer.listOnTimeout (timers.js:198:5) 
RequestError: [f909ee1b-334a-40ed-94ec-4398c12bd442] 'Product Images' terminated. Complete error: 
Error: Invalid URI "http:///%7B%7BbaseUrl%7D%7D/shop/%7B%7BapiVer%7D%7D/products/samsung-ypk3/images?client_id=%7B%7BclientId%7D%7D" 
    at Request.init (/usr/local/lib/node_modules/newman/node_modules/request/request.js:288:31) 
    at new Request (/usr/local/lib/node_modules/newman/node_modules/request/request.js:142:8) 
    at request (/usr/local/lib/node_modules/newman/node_modules/request/index.js:55:10) 
    at Object.jsface.Class._execute (/usr/local/lib/node_modules/newman/src/runners/RequestRunner.js:181:26) 
    at Timeout._onTimeout (/usr/local/lib/node_modules/newman/src/runners/RequestRunner.js:222:20) 
    at tryOnTimeout (timers.js:224:11) 
    at Timer.listOnTimeout (timers.js:198:5) 

的URI在郵差看起來是這樣的 -

http://{{baseUrl}}/{{apiType}}/{{apiVer}}/products/{{productId}}?client_id={{clientId}} 

當我打開該集合的JSON文件,這是URI的外觀 -

"url": "http://{{baseUrl}}/{{apiType}}/{{apiVer}}/products/{{productId}}?client_id={{clientId}}" 

關於什麼可能導致無效的URI錯誤的任何想法?

更新了紐曼調用以下 -

newman -c Products.postman_collection.json -e globals.postman_globals.json -e Products.postman_environment.json 

,其中第一的環境變量文件是郵差全局和第二的環境變量文件是收集特定ENV瓦爾。仍然看到相同的錯誤。

回答

0

必須使用-g選項傳遞全局文件。所以最後的命令看起來像 -

newman -c Products.postman_collection.json -g globals.postman_globals.json -e Products.postman_environment.json