Hello Gatling experts,
Could you please advise how to perform following simulation.
As user types in search word, Browser Sends search request and shows possible search terms.
eg: when user tries to type housing, following search requests are sent to the server
- /service/search/ac?q=hou
- /service/search/ac?q=hous
- /service/search/ac?q=housi
- /service/search/ac?q=housin
- /service/search/ac?q=housing
I am trying to create simulation for this scenario.
.feed(feeder)
.group(“Search from home page”){
exec(http(“request_28”)
//.get("/service/search/ac?q=hou")
.get("/service/search/ac")
.queryParam( “”“q”"", “${searchCriterion}.dropRight(2)”) ===> My intention is to perform search using Search term with last 2 chars truncated. This is not working. Instead search performed with “SearchCritera + dropRight(2)” string"
// .queryParam( “”“q”"", "${searchCriterion}"dropRight(2)) ====> This approach giving compile error
.headers(headers_28)
.resources(
http(“request_29”)
//.get(uri4 + “/service/search/ac?q=housi”)
.get(uri4 + “/service/search/ac”)
.queryParam( “”“q”"", “${searchCriterion}.dropRight(1)”)
.headers(headers_28),
http(“request_30”)
// .get(uri4 + “/service/search/ac?q=housing”)
.get(uri4 + “/service/search/ac”)
.queryParam(""“q”"", “${searchCriterion}”)
.headers(headers_28),
http(“request_32”)
.get(uri4 + “/search?q=${searchCriterion}&cat=sitesearch”) ==> This is working
.headers(headers_0)
.check(regex("""
}
Please could you also advise how to select first search result, using regular expression. search results listed for following search results
-
Apply for housing
Find a place to live with a council or registered social landlord.
-
Emergency housing if you’re homeless
Find out your options if you’re homeless and don’t have anywhere to stay tonight.
Thanks in advance.
Regards,
Raja