Solved

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

Posted on 2010-08-13
3
816 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
Comment Utility
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
Comment Utility
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
Comment Utility
As far as I know, that's not possible. The csv file is read sequentially.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Let’s list some of the technologies that enable smooth teleworking. 
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now