HenlenLee
HenlenLee

Reputation: 445

How to modify the csv feed file in gatling

I have a user.csv file like this:

user, password
userid1, password1

I want to decrypt the password in the csv file. One way is .feed(csv("user.csv")) and then

.exec(session => {
        val pwd = session("password").as[String]
        session.set("password", decrypt(pwd))//some function to decrypt the password
      })

Now I want to decrypt the password before feed the csv file. Is there any way to do that in Gatling?

Upvotes: 0

Views: 963

Answers (1)

James Warr
James Warr

Reputation: 2604

You can add a conversion to a feeder definition with a function that will convert a given value.

https://docs.gatling.io/reference/script/core/session/feeders/#transform

looks like your use-case

Upvotes: 1

Related Questions