Please I need help to resolve this error: Failed to build request get login page: No attribute named 'User' is defined

Hi All,

I am new to Gatling. Please I need help to resolve the error mentioned above. I could see result for “Login page”, “News” and “News_redirect”. However, the post request “Login” does not appear to work. It gives the above error.

I want this script to pick staff username and password from staff.csv file to login and then go to News page for 50 users. Thank you

val headers_1 = Map(“Accept” → “/”)

val feeder = csv(“staff.csv”).random

val scn = scenario(“Login page”)

.exec(http(“Login page”)
regex(""“input type=“hidden” name=“security” class=“js-csrf-token” id=“security” value=”([^"]*)""").


.exec(http(“get login”)

.formParam(“username”, “${User}”)
.formParam(“password”, “${Pass}”)
.formParam(“submit”, “Sign in”)
.formParam(“security”, “${securityToken}”)
.body(StringBody("""{ “${User}” }""")))

.pause (3)


I think the problems is with feeder.
At your csv file, in the first row and column has the value ‘User’?

I meant the value ‘User’ at the first line.
Look at

Thanks Lavio,
Which of the csv format is correct? no space in between the values except commas. The second one has its values on separate columns.

I have tested with both but still have the same problem.

I look forward to hearing from you soon.



user2 - Copy.PNG


The problem is that you don’t know the first line is the label of data, I think you should do this


This was exactly how it was before I posted the question to the group.

I’m new to gatling too. I don’t have more suggestions.

My csv


Code (it’s working)

object GERID {

val usuario = csv(“usuarios.csv”)
val login = exec(http(“HOME SIBE”)
.check(regex(“Acesso via Senha”),
css(“input[name=lt]”, “value”).saveAs(“lt”),
css(“input[name=execution]”, “value”).saveAs(“execution”))
//.exec { session => println(session(“responseBody”).as[String]); session }
.exec(http(“LOGIN GERID”)
.post(uri1 + “?service=http%3A%2F%2Fhsibepuapr01%2FPortalSibe%2Fpages%2Findex.xhtml”)
.formParam(“username”, “${cpf}”)
.formParam(“password”, “${senha}”)
.formParam(“lt”, “${lt}”)
.formParam(“execution”, “${execution}”)
.formParam("_eventId", “submit”)
.formParam(“submit”, “Entrar”)


Ok thanks a lot. I will check this out.

Hello Flavio,

This is still not working.

val scn = scenario("NewDevTest")

  .exec(http("Get Login Page")
  regex("""input type="hidden" name="security" class="js-csrf-token" id="security" value="([^"]*)""").find.saveAs("securityToken")))

  .formParam("username", "${username}")
  .formParam("password", "${Password}")
  .formParam("submit", "Sign in")
  .formParam("security", "${securityToken}")
  .check(regex("get login page"))
  .body(StringBody("""{ "${username}" }""")))

I don’t know what is your error but it could be the check.
exec(http(“Get Login Page”)
css(“input[name=security]”, “value”).saveAs(“securityToken”)))


Hi Flavio,

I managed to fix it. The line below was not necessary and was embedded as part of the exec(Login) .check(regex(“get login page”))