集合有两个请求。
- 发布-创建帐户
- 发布-创建accountProfile
创建accountProfile将一个accountProfile对象添加到该帐户中。
有13种帐户配置文件类型。
我要做的是创建13个帐户,每种帐户类型一个。
第二种方法是Tests
中的Javascript。
现在不用担心硬编码。我待会儿解决。
var acctProfiles = [0,1,4,5,6,19,33,34,35,38,39,40]
for (var p in acctProfiles ) {
// Create account with that profile
console.log('creating account');
postman.setNextRequest("Create account");
console.log(pm.collectionVariables.get("accountToken"));
pm.collectionVariables.set("profileType",profiles[p]);
console.log('creating profile');
// Now call this request to create the profile
postman.setNextRequest();
}
我在收藏跑步者中运行了这个收藏。
它成功运行了每个请求,但只有一次。
它只使用了数组中的最后一个元素40。
因此,创建了一个具有一个帐户配置文件的帐户,而没有更多内容。