Solved

JMeter Configuration

Posted on 2004-04-27
5
1,421 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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
topping2 challenge 13 94
C# DataGridView_RowsAdded event not firing 1 82
Change the background and font colors in Notepad++ 5 112
Generate Unique ID in VB.NET 21 60
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
A short article about a problem I had getting the GPS LocationListener working.
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…

860 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