Hi guys,
I'm new to Scala + Gatling and I'm struggling to iterate over a list of elements. I'm currently using Gatling 2.2.2
Here is what I'm trying to do:
I'm hitting an URL that returns 3 cookie values in this format (it could return more than 3 too):
["EAF83CB53F707255BA311219D5BC6D6BFD78DA4928F6C237430F4CFAC4CBCCF708CC065B8FAA2F16E467E13A5BB7E476643E8F29A5347B1026D3FB2F4DF0B611983502C8D689AF4393388F33E8A5088A13FDE73E5A89FA5B03097E962F4132D66FD64E0883D9F993B24FF808C70CD452B1B5D818869A5133677882FC6F54B2472769BBBC6A30BA77AC679B9FB38D8549DF6C86F6CACC5CC25EF5ADC8BEBEC2DB1D5B2F39153159BD00ED80802E20152DABB6A82CF54F5F67E59D1EA5F849545A071C31C999320F24BCA683C534B50108C3013CAE","6B8F1B38019FA08B7036879AD66B5EAC3ADBCA825F8C9D80F08B99B50BD5A0E8D9D163C4495CE67606031540C6CFD9275B6B676B22E21407A4F268B7A8945CA46641C9171319EEC57CC0EC2A4947D64A2022FABE872D3D64E4FDC2138E99B115C06FAAFEB6E5ADFB6734BD43CC37507C792D9AACED3B8EEECF66716DF5582715BC30148DCCF745B005603BFA07EB1047D38FD6DF20904A420D4FF1B108F373CB4332ED1B67E7B652378888EF858C4D3104D2573B3C79162032A222F26590E2EA179F91BF5F3EC1135878468F2E1FECBEAE053AFA","EE5B5B2F766B8A1F92870A168E24C50937DEFB6660FF8EAD77D632299B45655431C8F9F0C4EA9CEE1B072363300F15C1DBF67AEF5AD1224434CD5E874F0749D9FB89746EC23FE5D9FF54CEBA7ED57B58B038FC2FD2B14F8B74CF4FE026D4CEEC7B3FDBD6C5596ED0AE812C9F0C16DE20C02C4B3314B05142D834D7F0ED3D18BA69645B48F91CDDE7AAC3FBB94D8815D14CA324B531A74158E1C2F57A4E55F89971F4BAB6869F8C0D6C66809EEA3B3B3BCC8B6FC13015296E93FFA22D768EC6F760C2E65166E4E086C8AED2EB401577B48E9DF8FA"]
I'd like to do a forEach() to iterate over each of these 3 values and use the values to make a request for each of them.
I'm able to save this data using findAll() + saveAs() but I'm struggling to break it into 3 different parts. Basically, when I try to iterate over the elements, I keep getting the whole element instead of just each piece. I did some research and it seems I may have to use map() + mkString() + transform() to convert the data structure above in a simpler format that I can iterate, but not really sure how to do it.