Hi All,
I am trying to build a scenario for a typeahead search. The typeahead doesn't kick in till 3 characters are typed. I have following code written for it.
val typeaheadparam = csv("SearchTermUS.csv")
val typeaheadservice = scenario("Typeahead Service")
.feed(typeaheadparam)
exec( session => {
repeat((session("SearchTermUS").as[String]).length() - 3,"Counter") {
println("Search Term : " + (session("SearchTermUS").as[String]))
println("Search Term Length : " + (session("SearchTermUS").as[String]).length())
println("Inside the Long Loop, Count Value : " + session("Counter").as[Int])
exec(http("Typeahead Service")
.headers(common_header)
.queryParam("term",(session("SearchTermUS").as[String]).substring(0,session("Counter").as[Int]+3))
.queryParam("lang_locale","en_US")
.queryParam("limit","4")
// println( "Search with term : " + (session("SearchTermUS").as[String]).substring(0,session("Counter").as[Int] +3))
// pause(1)
session } )
The code does compile. The problem is when it is being executed using the following command
searchServiceScenario.typeaheadservice.inject(rampUsersPerSec(1) to(peakRPSScenario1) during (rampTime seconds), constantUsersPerSec(peakRPSScenario1) during(steadyTime seconds))
It goes in repeat loop but is not in the executing any request.
What's wrong in the above code?
Regards,
Sanjaya