Need help to create simple scenario using Gatling

Hello all,

I am new to Gatling and Scala,

I want to create two simple scenarios using Gatling. I have installed scala plugin in eclipse. Installed Gatling. I am able to run basic simulations present in Gatling’s zip folder from command prompt. I tried to write below script FacebookLogin.scala. In cmd it gives error- missing semicolon before value param.

Please let me know best resources to learn Gatling as well.

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class FacebookLogin extends Simulation {

val httpConf = http
.baseURL(“https://www.facebook.com”)
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)
.doNotTrackHeader(“1”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)

val scn = scenario(“LoginToFacebook”)
.exec(http(“Login page”)
.get("/"))

.exec(http(“Login”).post("/login")
.param(“username”, “user”)
.param(“password”,“password”)
.check(css(“username”).is(“user”))

setUp(scn.inject(atOnceUsers(1)).protocols(httpConf))
}

You probably used an old documentation or outdated samples found on the Internet.
Param has been renamed into formParam. Check migration guides.

Thanks Stephane,

It worked.