Mock tests, Interview questions, Tutorials and Tech news
 
 
Home > Programming / tutorials > Reading data from CSV or excel file in JMeter

Reading data from CSV or excel file in JMeter

Apache JMeter is one of the best open source load testing tools available in market. We had covered Load Testing Using Apache Jmeter in our previous post.

In this post I will go into some more details as how you can read data from csv or text file for Jmeter. This is helpful when you are doing a load test and need unique user id or any other parameter.

CSV Data Set Config settings in Jmeter console

CSV data set in jmeter

CSV data set in jmeter

This file will reside in bin directory of your Jmeter directory.

userid is the variable you will be using in your url for eg

http://www.abc.com/welcome.jsp&userid=${userid}

How your Myfile.csv file will look like ?

1234
1245
1257

and so on

if you want multiple parameters,  you can have comma separated values like

1234,88
1245,99
1257,44

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • IndianPad
  • Reddit
  1. mirec
    September 16th, 2011 at 08:16 | #1

    Kishore :
    Hi,
    I was trying to use CSV dataset config in my FTP test. But I was unsuccessful. I have around 180 text files that need to be transferre to the remote server. So my Local file and remote file fields in FTP request I tried to use the variable for file name as below
    Local file– C:\Documents and Settings\ky\Desktop\KK\${Name}
    Remote file– /TestPerf2/${Name}
    and in CSV dataset config I have set variable name as “Name” and delimer aas “,” and I have a csv file in “bin” with all the file names from my local file location.Is there something wrong with the way I declared variable or does this not work for FTP request test?
    Please help!!!

    Put csv file in the same directory as your test plan, not in “bin”

  2. mirec
    September 16th, 2011 at 08:15 | #2

    Put csv file in the same directory as your test plan, not in “bin”

  3. mirec
    September 16th, 2011 at 02:53 | #3

    @Kishore
    Hi,
    Copy the csv file in the same directory as your test plan

  4. Kishore
    February 21st, 2011 at 13:42 | #4

    My csv file is in “bin”. I was able to perform the FTP request from the “Local file” path manually creating 180 FTP requests in the Jmeter script. But when I tried to use CSV dataset config, I was unsuccessful..

    @Vinay

  5. February 18th, 2011 at 16:21 | #5

    Kishore
    The problem might be spaces in “Documents and Setting”.
    Is the csv file in bin directory of your Jmeter ?

  6. Kishore
    February 18th, 2011 at 15:52 | #6

    Hi,
    I was trying to use CSV dataset config in my FTP test. But I was unsuccessful. I have around 180 text files that need to be transferre to the remote server. So my Local file and remote file fields in FTP request I tried to use the variable for file name as below
    Local file– C:\Documents and Settings\ky\Desktop\KK\${Name}
    Remote file– /TestPerf2/${Name}
    and in CSV dataset config I have set variable name as “Name” and delimer aas “,” and I have a csv file in “bin” with all the file names from my local file location.Is there something wrong with the way I declared variable or does this not work for FTP request test?
    Please help!!!

  7. sapna
    January 7th, 2011 at 01:32 | #7

    Hi,
    Thanks

  8. sapna
    January 7th, 2011 at 01:31 | #8

    Hi,
    Thanks it helped me a lot.

  9. Moses
    August 9th, 2010 at 03:18 | #9

    Thanks for the info… It was useful to start up with CSV Data Set Config

  1. No trackbacks yet.
Get Adobe Flash playerPlugin by wpburn.com wordpress themes