failed : status()

well, Hi all people, Am new with gatling, am making a test at login page but when I wnat to send login paramaters I have a error like this “failed : status().in(Range200,201…()”, to definition is the following

val scn = scenario(“prueba geiner”)
.group(“Login”) {
exec(
http(“request_2”)
.get(“http://localhost:8084/test2/index.jsp”)
.headers(headers_1))
.pause(12, 13)
.exec(
http(“request_3”)
.post(“sesion1.jsp”)
.param(“user”, “geiner”)
.param(“pass”, “111”)
.headers(headers_3))
}

it is a simple test.

Please some one can helpme.

Did you defined a baseUrl?
For the first request, you give a full url and a relative one in the second request.

I think that, all code that i have is the following

package basic

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import io.gatling.http.Headers.Names._
import scala.concurrent.duration._
import bootstrap._
import assertions._

class BasicExampleSimulation extends Simulation {

val httpProtocol = http
.baseURL(“http://localhost:8084/test2/index.jsp”)
.acceptCharsetHeader(“ISO-8859-1,utf-8;q=0.7,;q=0.7")
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,
/*;q=0.8”)
.acceptEncodingHeader(“gzip, deflate”)
.acceptLanguageHeader(“fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3”)
.disableFollowRedirect

val headers_1 = Map(
“Keep-Alive” → “115”)

val headers_3 = Map(
“Keep-Alive” → “115”,
“Content-Type” → “application/x-www-form-urlencoded”)

val headers_6 = Map(
“Accept” → “application/json, text/javascript, /; q=0.01”,
“Keep-Alive” → “115”,
“X-Requested-With” → “XMLHttpRequest”)

val scn = scenario(“prueba geiner”)
.group(“Login”) {
exec(
http(“request_2”)
.get(“http://localhost:8084/test2/index.jsp”)
.headers(headers_1))
.pause(12, 13)
.exec(
http(“request_3”)
.post(“sesion1.jsp”)
.param(“user”, “geiner”)
.param(“pass”, “111”)
.headers(headers_3))
}

setUp(scn.inject(ramp(5 users) over (10 seconds)))
.protocols(httpProtocol)
.assertions(
global.successfulRequests.percent.is(100), details(“Login” / “request_3”).responseTime.max.lessThan(2000),
details(“request_3”).requestsPerSec.greaterThan(10))
}

The meaning of baseUrl is that it’s prepended to all non absolute urls, so with what you’ve done, “sesion1.jsp” is turned into “http://localhost:8084/test2/index.jspsesion1.jsp” which is non sense.

Your proper baseUrl is probably http://localhost:8084/test2/

yes this was the mistake. :wink: