I want to generate the InjectionProfile using a loop for the provided code

I have written below code where the scenarios are created dynamically using a loop and a reusable method. I want to generate InjectionProfiles using a reusable method for the below code. Please help for the same:

package neutronsApis;

import io.gatling.javaapi.core.ScenarioBuilder;
import io.gatling.javaapi.core.Simulation;
import io.gatling.javaapi.http.HttpProtocolBuilder;
import static io.gatling.javaapi.core.CoreDsl.*;
import utils.configReader;
import utils.reusableMethods;

public class applicantDedupe extends Simulation {
    private final ScenarioBuilder[] scnList;

    public int users = 100;
    public HttpProtocolBuilder httpProtocol = reusableMethods.createHttpProtocolBuilder(configReader.getProperty("visionBaseUrl"));

    {
        scnList = reusableMethods.scnListWithoutRequestBody("applicantDedupe", "POST", "/api/v1/applicant/89563/dedupe", 200);
    }

    {
        setUp(
                scnList[0].injectOpen(rampUsers(100).during(30))
                        .andThen(
                                scnList[1].injectOpen(nothingFor(30), rampUsers(200).during(30))
                        )
                        .andThen(
                                scnList[2].injectOpen(nothingFor(30), rampUsers(300).during(30))
                        )
                        .andThen(
                                scnList[3].injectOpen(nothingFor(30), rampUsers(400).during(30))
                        )
                        .andThen(
                                scnList[4].injectOpen(nothingFor(30), rampUsers(500).during(30))
                        )
        ).protocols(httpProtocol);
    }



}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.