I have this:
`
.doIf(session => ! session(“itemList”).as[Seq[String]].isEmpty) //here i want to limit the loop to just run 8 iterations even if the ‘itemlist’ is more than 8
{
foreach("${itemList}", “item”)
{
//pace(1 seconds, 2 seconds)
exec(
http(“activateOffer”)
.post("/offer/activate")
.header(“X-Token”, “${token}”)
.body(StringBody("""{“offerId”: “${item}”, “membershipId”: “${MemberId}”, “osName”: “Android”, “osVersion”: “4.4”}""")).asJSON
.check(jsonPath("$.resultCode").is(“SUCCESS”))
)
}
}.exitHereIfFailed
`
How can I limit the doif loop to only run maximum 8 times? even if the itemlist is more than 8?
can I include a ‘&& <9’ in the end of the condition of the loop? how is the syntax?
Cheers