Hi,
I am new to Gatling and learning through the documentation available online @ http://gatling.io/docs/2.0.0-RC2/cookbook/passing_parameters.html.
I was trying to read a parameter from command line and it says me
“[ERROR] i.g.h.a.HttpRequestAction - No attribute named ‘urlHost’ is defined
[ERROR] i.g.h.a.HttpRequestAction - No attribute named ‘urlHost’ is defined
[ERROR] i.g.h.a.HttpRequestAction - No attribute named ‘urlHost’ is defined”
Below are the files that i used.
`
package #######.########
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import Headers._
class BasicSimulation extends Simulation {
val urlHost = System.getProperty(“URL_HOST”)
val nbUsers:Int = java.lang.Integer.getInteger(“users”, 1)
val myRamp:Long = java.lang.Long.getLong(“ramp”, 0L)
val httpProtocol = http
.baseURL("${urlHost
}")
.acceptHeader("/")
.acceptEncodingHeader(“gzip,deflate,sdch”)
.acceptLanguageHeader(“en-US,en;q=0.8”)
.connection(“keep-alive”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36”)
val scn = scenario(“Authentication for LogIn and Card Creation”)
.exec(http(“Authentication”)
.post("""/sample""")
.headers(headers_1)
.header(“Developerid”, “${loginUser}”)
.header(“Developerpassword”,"${loginPwd}")
.header(“Origin”, “${urlHost}”)
.check(status.is(200)))
setUp(scn.inject(rampUsers(nbUsers) over (myRamp seconds)).protocols(httpProtocol))
}
`
Can you let me know if i am missing anything.
Thanks,
Sujatha