Saved Check Not Defined

Hello,
I’m having some problems passing saved values between requests. Here is an example script:

.get("""/myrequest""")
.resources(http(“MyRequestResources”)
.get(uri1 + “”"/anotherRequest""")
.check(regex(“Param1”).exists)
.check(regex(“Param2”).exists)
.check(regex("""<Param1""").saveAs(“Param1”))
.check(regex("""""").saveAs(“Param2”)),
http(“NextRequest”)
.post(uri1 + “”"/nextrequest""")
// .formParam(""“Param1"”", “${Param1}”)
// .formParam(""“Param2"”", “${Param2}”)

When I execute the script the ‘NextRequest’ step fails staging that ‘Param1’ and ‘Param2’ have not been defined. Is this something to do with the state of the session?

Any help is appreciated.

I think I have cracked this by adding .exec command for the NextRequest!

Resources are executed in parallel, so each one has its own “scoped state” that gets reconciliated only once all of them are fetched.
Making it short: you can’t save data from a resource and expect it to be available in another one (of the same resources block).