Session foreach error

Hey,

I have this code that the foreach can’t read from the saveAs. Any ideas?

val getExample = exec(http("")
      .get(baseUrl)
      .header()
      .header()
      .check(jsonPath("$..id").findAll.saveAs("ids")))

      .foreach("${ids}", "id") {
          exec(session => {
            println("hello")
            session
          })
      }

If I do another .exec before the foreach, I can print out the vector that I get back. It comes back as Vector(1,2,3,4). So I would expect this to print hello 4 times, expect
the loop breaks because it cannot find the ids.

Thank you for the help!

val users = scenario(“Users”)

.exec(http(“json”)

.get(“https://jsonplaceholder.typicode.com/posts”)

.check(jsonPath("$…id").findAll.saveAs(“ids”)))

.foreach("${ids}", “id”) {

exec(session => {

println(“hello”)

session

})

}

setUp(users.inject(atOnceUsers(1)))

works fine for me