When the script run, 2 VUs running parellel. My problem is testLabel should be unique for every user when I use post method. For example,testLabel should be PCK-L-01 for one user, at the same time testLabel should be PCK-L-02 for other user. Maybe I can increase the VUs number until 5.I tried to combine trolley and counter in my example(e.g. PCK-L-01). The main problem is that the value of trolleys should be different at the same time as the number of users. If any alternative ways are available, I will be happy
My options like below;
export const options = {
scenarios: {
CreatePicking: {
executor: 'per-vu-iterations',
exec: 'CreatePicking',
vus: 2,
iterations: 1
},
}
}
My export fuction code below;
export function CreatePicking(data) {
let trolley= "PCK-L-0"
let counter=0;
counter++;
let generateTokenHeader = {
headers: {
'Authorization': `Bearer ${data.access_token}`,
'content-type': 'application/json',
},
};
describe('Continue picking', (t) => {
let continueIfExistRes = http.post(requestUrlAPI + 'Picking.continue', JSON.stringify({
testLabel:`${trolley.concat(counter)}`
}), generateTokenHeader
)
t.expect(continueIfExistRes.status).toEqual(200);
});
}