Solved

JMeter Configuration

Posted on 2004-04-27
5
1,407 Views
Last Modified: 2011-09-20
This is  regarding passing data to JMeter.
I have generated two data files (for parameters that are to be used by JMeter for driving the load test) and want JMeter to read the data from these files before starting any of my test cases.

Is there some way to configure these files for JMeter(I mean can we place these files at some location for Jmeter access(or can we specify the paths of these files in configuration parameters?

(These parameters being intialization parameters , I dont want to pass these parameters from the exernal java request, that is the class that implements the JavaSamplerClient interface)
 
Thanks and Regards
Priya
0
Comment
Question by:priya_soparkar
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
someman4oneman earned 500 total points
ID: 10943817
Hi priya_soparkar
In JMeter
Go to Options --> Function Helper Dialog

In the drop downmenu choose _StringFromFile
This will load you params from a file.

See
http://jakarta.apache.org/jmeter/usermanual/functions.html

0
 

Author Comment

by:priya_soparkar
ID: 10948729
Hi !
Thanks for the response.
One doubt , as the Apache documentation specifies , the _StringFromFile
function reads one complete line for each request .

In my case i have 3 attributes that constitute one record in the file that is to be read  and I want to read these 3 attributes as 3 parameters.

e.g .in my file i have one record of
Val1  Val2 Val3
and I want to read these 3 values in 3 parameters as one record .
Can we do this using _StringFromFile ?

I came across the "user-defined function" option in the same category but unfortunately documentation doesnt specify how to specify parameters in this user defined function and get them in user parameters.


Thanks and Regards
Priya
0
 
LVL 1

Expert Comment

by:someman4oneman
ID: 10952786
priya_soparkar
I did some more sniffing round and it would appear that the
users.xml in the bin folder is more like what you are looking for.

As well as the docs there is
http://www.newsforge.com/software/04/02/19/1452218.shtml

to show you what is happening.


0
 

Author Comment

by:priya_soparkar
ID: 11002871
Hi !
In  my scenario, I have the data file for say 100000 records  which i want to use for JMeter to pass data for each thread.
Now my application spawns 100 threads for say 5 iterations and I the requirement is such that intial 100 thread will use first 100 records form the data file in first iteration.
In next iteration the same 100 threads should now records from 101 onwards .
So in each iteration the threads will use different data.

(I understand that when we execute the threads in the loop, chanding the
data for the thread does not sound logical).

So is that the right approach to
1) Add a user defined function class in JMeter's oprn source in
org.apache.jmeter.functions
2)Here, open the file ,read the values for 100 records.
3)Maintain file pointer(say with last record read)
4)For next set of records to be read use this pointer for "next" record
5)Close the file when total number of samples are spawned.
(That means in a file of 1000 records if 100 threads are spawned 5 times , 50 records will be read).

Please correct me if i am misinterpretting something.

And the other option that u have mentioned about users.xml file,
I still not able to map the relation of
<thread>
           <par1>
                 <par1-name></par1-name>
                 <par1-value></par1-value>
          </par1>
          <par2>
                 <par2-name></par1-name>
                 <par2-value></par2-value>
           </par2>
</thread>

JMeter documentation says that each <thread></thread> block corresponds to each user paramaters.

So cant this be used in the sceanio other than HTTP request ? Like here i want to use JavaRequest and get this data from some file ?

Please write comments on both scenarios if possible.
I am trying to find the best way to do this.

Thanks and Regards
Priya

0
 

Expert Comment

by:atmohsin
ID: 21881083
Hi Priya
    I am also facing the same problme. Let me know which solution you have adapted.

Mohsin
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Report events not being triggered 8 120
word0 challenge 3 89
Eclipse Neon start with Admin account only 6 119
cmd.exe will not close when running .bat file to perform FTP upload 18 100
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

813 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

10 Experts available now in Live!

Get 1:1 Help Now