Solved

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

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
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.
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to use the Hootsuite Dashboard.

730 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