Solved

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

Posted on 2010-08-13
3
820 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 68
how to debug htl and js pages 8 39
restrict decimal places for double datatype 10 22
junit as external jar or library 7 24
A list of useful business intelligence software.
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.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

828 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