You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ph...@rcomext.com on 2003/06/03 11:07:16 UTC

RE: New To JMeter - Need help. - __CSVRead()





__CSVRead() example in attached zipped jmx (though don't yet know whether
it will be forwarded!)

Also see notes below about uniqueness of data values


Phil Evans


(See attached file: Search18.zip)





                                                                                                                                    
                      "Puri, Manish"                                                                                                
                      <manishpuri@ti.co                                                                                             
                      m>                                                                                                            
                                                                                                                                    
                                                                                                                                    
                                               To:       "'JMeter Users List'" <jm...@jakarta.apache.org>                     
                      02/06/2003 15:35         cc:       (bcc: Phil Evans/External)                                                 
                      Please respond to        Subject:  RE: New To JMeter - Need help.                                             
                      "JMeter Users                                                                                                 
                      List"                                                                                                         
                                                                                                                                    
                                                                                                                                    




I 'll appreciate if yo can cut-paste an example.

-----Original Message-----
From: Phil_Evans@rcomext.com [mailto:Phil_Evans@rcomext.com]
Sent: Monday, June 02, 2003 4:33 AM
To: JMeter Users List
Subject: RE: New To JMeter - Need help.



Here's some notes on how to use __CSVRead(). The intention was to provide
LoadRunner-like parameterisation, so it should do the Job.

Hope it make's sense!!  If not I'll post an example


Cheers
Phil Evans



The CSVRead function returns data from a CSV formatted file. This is used
where parameter data must be varied for each iteration of the test plan.

A value is read by specifying the filename and position of the field within
a row as parameters to the function, eg:

${__CSVRead(c:/scripts/user.dat, 0) }                             (for a
Windows filename)

Note that variable positions in a row start at zero, and the value may be
read many times.


The next row in the file is accessed by issuing next() as the second
parameter:

${__CSVRead(c:/scripts/user.dat, next()) }

You need to create a dummy parameter in a sampler request in order to
execute next(), but this shouldn't be a problem for most applications - it
will just be ignored. It is also necessary to execute next() before reading
the first values from file. This means putting next() in a step that is
before the step where the first value is used.

Reading past the end of the file returns to the first record.

ALSO: The values returned are unique to each thread. So if you have many
threads, they will all see different data values.