Hi,
So I’ve been trying to create a basic gatling test case and have been running into runtime erros.
so here are the two cases I’ve been attempting to run:
class CurrencySimulation extends Simulation{
def run(): Unit = {
val scn = scenario(“Simulation name”).repeat(10) {
exec(
http(session => “Request description”)
.get(“http://www.google.com”) // full link to tested endpoint
.check(status is 500) // successful status
)
}
setUp(scn.inject(atOnceUsers(1)))
}
In this case I am getting a nullpointerexception where the get() is returning a null.
class CurrencySimulation extends Simulation{
def run(): Unit = {
val x = 5
val httpProtocol = http.baseURL(“http://www.google.com”)
val scn = scenario(“Simulation name”).repeat(10) {
exec(
http(session => “Request description”)
.get("/") // full link to tested endpoint
.check(status is 500) // successful status
)
}
setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}
}
this situation fails before it even gets to the scenariobuilder fails before it even gets to the ScenarioBuilder, as the httpProtocol returns a java.lang.ExceptionInInitializerError
If I could get an idea as to what I am doing wrong with these scripts it would be extremely helpful.
Thank you