1

I am pushing List Of Java Objects to my Gatling Feeders in scenario 1 and I am trying to access the objects in scenario 2.

here is my feeder code

object DataDequeHolder {
  val DataHolder = new ConcurrentLinkedDeque[List[HttpRecordedObject]]()
}

class DataFeeder extends Feeder[List[HttpRecordedObject]] {
  override def hasNext: Boolean = DataDequeHolder.DataHolder.size() > 0
  override def next(): Map[String, List[HttpRecordedObject]] = Map("data" -> DataDequeHolder.DataHolder.pollFirst())
}

scn = scn.exec(DataBuilderExecutor.generateTestUser()).feed(new DataFeeder())

How can I access the Feeder Objects and iterate over the list the recorded objects in my scenario?

  • What you want to do seems very similar to [this question](https://stackoverflow.com/questions/28217667/share-data-between-gatling-scenarios). – George Leung Mar 27 '21 at 17:50
  • I have gone through this result but he was putting string in feeder whereas I am putting List Of Objects and I want to iterated over those objects, how can I access that list is my question , I know in StringBody there is direct way ${data} – user3536104 Mar 29 '21 at 04:40
  • Do you want [`foreach`](https://gatling.io/docs/current/cheat-sheet/#scenario-definition-loops-foreach)? – George Leung Mar 29 '21 at 04:43
  • I want to know how can I access the one object from Feeder and iterate over the list, like looping over the list of HttpRecordedObject – user3536104 Apr 13 '21 at 16:51

0 Answers0