0

I want to store returned values from scenerio1 to list and use the same stored values in another scenerio .

I tried to do like below . but in get scenerio this gives error id not found . I also noticed that feeder is initialized before scenerio execution itself.

Could some one please help on this .

var l: List[String] = List()
var ids = l.map(id => Map(“id” -> id)).iterator
val install = scenario(" Install")
  .during(Configuration.duration) {
      group("installTest") {
        exec(
          testChain.installApplication()
        ).exec(session=>{
          l = session(“id”).as[String].trim :: l
          print(l)
          session
        })
      }
  }

val get = scenario(“get”)
  .during(Configuration.duration) {
    group(“getTest”) {
      feed(ids)
      exec(
        session=>{
          print(session(“id”).as[String])
          session
        }
      )
    }
  }


setUp(
  warmupScenario.inject(constantConcurrentUsers(1) during(1))
    .andThen(
      install.inject(nothingFor(10 seconds), (rampUsers(Configuration.users) during (Configuration.ramp seconds))))
    .andThen(
      get.inject(nothingFor(Configuration.duration seconds), (rampUsers(Configuration.users) during (Configuration.ramp seconds))))
)
  .assertions(details("installTest").successfulRequests.percent.gte(Configuration.passPercentage))
  .protocols(HTTP_PROTOCOL)
santosh jk
  • 111
  • 1
  • 11
  • Check this answer https://stackoverflow.com/a/69176137/7512201 – Amerousful Nov 21 '21 at 13:00
  • I want to run through all fetched values from install scenerio in get scenerio . but above link shows get authorization and use for others – santosh jk Nov 22 '21 at 10:36
  • Where you saw "get authorization" in answer below? That example describes the basic concept of passing variables between sessions. In the example, there is no binding to authorization or anything else. – Amerousful Nov 22 '21 at 15:25

0 Answers0