How can I solve ramping-vus executer problem?

I m using ramping-vus for executer. My ramping-vus option is like below;

export const options = {
    scenarios: {
        CreatePicking: {
            executor: 'ramping-vus',
            exec: 'CreatePicking',
            startVUs: 1,
            stages: [
                { duration: '260s', target: 1 },
            gracefulRampDown: '15s',

On the console I follow the responses. Two times responses comes true. But third time I m taking error like below.If I use more target I will give an error again after first times;

label is undefined

Some part of code is like below which I take error (createdpickingProcessReferenceNumber variable using in different describe so defined outside);

let  createdpickingProcessReferenceNumber;
 describe('test', (t) => {

            let res = + 'PickingProcess.create', JSON.stringify({
                kpiTrackingProcessId: `${kpiId}`
            }), generateTokenHeader
            let createdVariation = res.json().variation;
            createdpickingProcessReferenceNumber = res.json().pickingProcessReferenceNumber

            let createCarRes = + 'Vehicles.createPickingTrolleys', JSON.stringify({
                count: "3",
                increment: "2",
                prefix: randomString(20),
                start: faker.random.number(250),
                toteCount: "10",
                variation: `${createdVariation}`,
            }), generateTokenHeader)
            let createdLabel = createCarRes.json()[0].label

            let createPickingRes = + 'PickingProcess.startCreatedPicking', JSON.stringify({
                trolleyLabel: `${createdLabel}`,
                pickingProcessReferenceNumber: `${createdpickingProcessReferenceNumber}`,
            }), generateTokenHeader)
            createdCellLabel = createPickingRes.json().cellLabel
            createdAllocatedItemId = createPickingRes.json().allocatedItemId
            createdPickingToteLabel = createPickingRes.json().pickingToteLabel
            createdProductLabel = createPickingRes.json().productLabels
            currentState = createPickingRes.json().currenState.substring(

@mstoykov do u have an idea?

Hi @Yusuf,

I would expect you are talking about this line

            let createdLabel = createCarRes.json()[0].label

From your explanation that it worked 2 times but then failed, I would expect that the request for it failed. You do actually check this (somewhat) but you do it after you try to get the label.

You should be checking that the response is what you need and doing something about it if it isn’t - like aborting the iteration or retrying. This all depends on what you want though.

You can see some more information in Make your test code resilient.

Hope this helps you!