Custom feeder help

Hi,

I am stuck in creating a custom feeder. I would like to feed for example Empl1- Empl20. So I am creating a feeder as below but it complains about type mismatch Any help would be appreciated.

val UserID = (1 to 20).iterator val customFeeder = Iterator.continually(Map( "ClientID" -> ClientID, "Username" -> "Empl"+UserID.next() "Password" -> "123456789" ))

I get the below error

Gatling Feeder Error.png

I tried converting to String using

val UserID = (1 to 20).iterator
val customFeeder = Iterator.continually(Map(
“ClientID” → ClientID,
“Username” → “Empl”+(UserID.next()).toString()
“Password” → “123456789”
))

But still gives an error during compilation

Hi,
I have noticed in the snippet you posted there is a missing comma after next(). Could it be the issue?

Thanks,
Ponch

Gatling Feeder Error.png

Hi Fabio,

Thanks for taking the time to reply. Really appreciated. Unfortunately, ‘,’ is not an issue. Actually I used ‘,’ You can see in the 2nd screenshot that there is a ‘,’ after “Empl”+(UserID.next()).toString(),

With ‘,’ still the same issue

Gatling Feeder Error.png

Missing parens to wrap concat, otherwise arrow has precedence.

Hi Stephane,

Thanks for the reply, but I didn’t quite understand (beginner in programming) . If you could please post the correct syntax that will be very helpful.

“Username” → (“Empl”+UserID.next())

Thank you so much Stephane. I tried separate parentheses for both parts like this ("Empl")+(ID.next()) and it was not working. What a silly mistake I have done.

Appreciated for quick reply.