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);
}
}