?
Solved

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

Posted on 2010-08-13
3
Medium Priority
?
838 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
ioanton earned 1800 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
Viewers will learn how to use the Hootsuite Dashboard.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

762 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