简体   繁体   中英

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?

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

https://gatling.io/docs/current/session/feeder/#converting

looks like your use-case

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM