val r1 = exec(http(“req1”)
.get("/request1/")
.headers(h1)
.check(regex(“somepattern”).findAll.saveAs(“valueSource”))
.resources(http(“req2”)
.get("/request2/"),
http(“req3”)
.post(url)
.headers(h2)
.formParam(“item1”, “”"[{“param1”:“value1”, “param2”: “value2”}]""")
value2 needs to be derived dynamically as per the below computations:
Computations:
-
valueSource : Map[key,value]
-
Based on some calculations add more values into valueSource
-
Fetch value2 using a key ==> get a value by passing a key
Question: Where can be the above computations happen to fetch the value2 during run time dynamically either using
- session variables
- separate method → doesnt work since method gets executed first before “req1” is executed. so valueSource is empty in first place!
- anything else?
Please suggest.