Collection has two requests.
- Post - Create Account
- Post - Create AccountProfile
Create AccountProfile adds an AccountProfile object to the Account.
There are 13 account-profile-types.
What I want to do is create 13 accounts, one for each account type.
Here is the Javascript in Tests
for the second method.
Never mind the hard-coding for now. I'll fix that later.
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();
}
I ran this collection in the collection runner.
It ran each request successfully, but only once.
It only used the last element in the array, 40.
So, one account with one account-profile was created and no more.