Solved

JMeter: How can I pass different parameter values when calling the api

Posted on 2010-08-13
3
819 Views
Last Modified: 2013-12-13
I'm trying to load test an API, for each call to the API some of the values for the parameters will change.  How can I set it this up in JMeter?  

For example, say I have

http://myserver.domain.com/path/myscript.php?name=Joe&telephone=5115658910&car=bmw

So I want each new call to the api have a different name a telephone how can I do this in JMeter?

Right now I have it working to make several calls to a sinlge url with static values in the parameters, but I need each thread or api call to have different values sent.   How can I do this?  Please explain step by step, I'm new to JMeter.
0
Comment
Question by:warrior32
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
ioanton earned 450 total points
ID: 33437054
1. create a csv file containing all the values of your request parameters (comma separated)
2. add to your test plan a "CSV Data Set Config" element and configure it to point to the csv file
3. change the parameter values of the the HTTP Request sampler, so that they point to the values picked out from csv file.
Ex:
name = ${user}
telephone = ${phone}

Note that "user" and "phone" are the name of the variables as defined in the CSV Data Set Config.

For details, see:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config
0
 

Author Comment

by:warrior32
ID: 33470539
Thanks, Ioaton, it worked.  I will give you the 350 points, but I need to randomize which values it picks from, so each thread picks a random value from the csv file, how can I do that?
I will bump the points up to 450.
0
 
LVL 9

Expert Comment

by:ioanton
ID: 33472325
As far as I know, that's not possible. The csv file is read sequentially.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question