Run gatling project

Gatling version: 3.11.5 (must be up to date)
Gatling flavor: [ java]
Gatling build tool: [maven]

Dear all,
I have a new maven project which have similar to gatling plugin project. I wonder how to run the load testing using maven. I had tried using test command but it doesn’t run. Please teach me on how to run it.

Thanks in advance.

package com.rev.stressTesting;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.*;

import io.gatling.javaapi.core.*;
import io.gatling.javaapi.http.*;

import java.util.concurrent.ThreadLocalRandom;

public class stressTesting extends Simulation{

    // Add the HttpProtocolBuilder:
    HttpProtocolBuilder httpProtocol =
            http.baseUrl("https://ticket.revid.my/")
                    .acceptHeader("application/json")
                    .contentTypeHeader("application/json");

    // Add the ScenarioBuilder:
    ScenarioBuilder homepageScenario = scenario("Street Testing Scenario")
            .exec(http("Homepage Request").get("/"));

    {
        setUp(
                homepageScenario.injectOpen(constantUsersPerSec(20).during(60))
        ).protocols(httpProtocol);
    }
}

Hello,

It’s impossible to help you without you providing a full reproducer.

I have a new maven project which have similar to gatling plugin project.

You should probably try to spot the difference. You can check for yourself that the demo project works as expected: GitHub - gatling/gatling-maven-plugin-demo-java

How to run the project if case i clone the project you mentioned.

I had search the documentation, The correct command is mvn gatling:test

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