Solved

JMeter Configuration

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 77
splitOdd10 challenge 5 80
wordmultiple challenge 12 119
This code tracks birthdays 3 60
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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 …

920 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

17 Experts available now in Live!

Get 1:1 Help Now