How to print the csv values on console???

1,128 views
Skip to first unread message

47sai...@gmail.com

unread,
Nov 8, 2014, 4:48:05 AM11/8/14
to gat...@googlegroups.com
Hi,

   I am new to gatling,can any body please tell me wats the way to print csv values on console...Suppose if we are passing values form csv file using feeder and from that i have to see the values are coming 
pefectly or  not...so how to print those variable values on console in .exec method...please help me


Thanks

Abhinav Gogna

unread,
Nov 8, 2014, 8:10:38 AM11/8/14
to gat...@googlegroups.com
.exec({session=> println(session("yourFeeder")
Session})

47sai...@gmail.com

unread,
Nov 9, 2014, 6:43:38 AM11/9/14
to gat...@googlegroups.com
Thank you,But in my case I want to check the value every time in case of username and password is getting from csv file...can you plz give solution in that situation...

John Arrowwood

unread,
Nov 10, 2014, 10:57:16 AM11/10/14
to gat...@googlegroups.com
Substitute "yourFeeder" with the names of the columns from the CSV that you want to output.  For example, if your CSV contains, among other things, a username and a password field, you might do something like this:

feed( csv("user_data.csv").circular )
.exec( session => {
  println
( "USER:     " + session("username").as[String] )
  println
( "PASSWORD: " + session("password").as[String] )
  session
})
Reply all
Reply to author
Forward
0 new messages