You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Dan Yuen <dy...@yahoo.com> on 2003/10/31 01:54:43 UTC

Using csv data as input

We are considering moving our application testing over
to jMeter and are looking at how we would need to
modify jMeter to fit our company needs.  Specifically,
we have a test generation tool that produces a csv
file which contains, among other things, inputs for
test cases (which I'm thinking would convert into
Samplers) and expected outputs (which I'm thinking
would get converted into Assertions for those
Samplers).  

What would be the best way to convert the csv data
into Samplers and Assertions?  Are there certain
classes that can easily be extended so that I can read
a csv file and convert each line into a Sampler with
associated Assertions and add them to my Test Plan? 
Or would it be much easier and quicker to just write a
csv to jmx converter?  

It seems the latter would be quicker in the short run
but would require running the converter as an
intermediate step before we run jMeter.  So, before we
make a decision on which road to take, I'm trying to
get my arms around what would be involved with
extending jMeter to use the csv file directly.

Can you help?  If so, thanks for any advice/direction
you can give.

Dan Yuen

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Using csv data as input

Posted by ms...@apache.org.
I see two good options for you:
1.  There is a new LogParser Sampler (and now a LogParser Controller soon to be added) 
that reads access logs and creates HTTPSamplers on the fly.  The LogParser and Generator 
are interfaces you could implement to parse your CSV files.  The downside here is that it's not 
a great solution for load testing, since the parsing is somewhat heavy.  It also doesn't support 
making assertions on the fly.
2. JMeter has routines to load .jmx files and convert them into JMeter TestElement classes.  
You could implement a new loading mechanism that likewise reads your csv files and creates 
TestElements.  To do this, you'd just have to make a new action class (like 
org.apache.jmeter.gui.action.Load) that does this - most of the code exists and you can 
copy/extend it, but add your own file parsing.  You'd then also have to add a new menu option 
(ie Open CSV, or something).  The downside here is that you'd be digging a little deeper into 
the internals of JMeter's GUI system, which has a somewhat steep learning curve.  It could 
also result in very high memory usage if you have large csv files that represent many 
samplers and assertions.

-Mike

On 30 Oct 2003 at 16:54, Dan Yuen wrote:

> We are considering moving our application testing over
> to jMeter and are looking at how we would need to
> modify jMeter to fit our company needs.  Specifically,
> we have a test generation tool that produces a csv
> file which contains, among other things, inputs for
> test cases (which I'm thinking would convert into
> Samplers) and expected outputs (which I'm thinking
> would get converted into Assertions for those
> Samplers).  
> 
> What would be the best way to convert the csv data
> into Samplers and Assertions?  Are there certain
> classes that can easily be extended so that I can read
> a csv file and convert each line into a Sampler with
> associated Assertions and add them to my Test Plan? 
> Or would it be much easier and quicker to just write a
> csv to jmx converter?  
> 
> It seems the latter would be quicker in the short run
> but would require running the converter as an
> intermediate step before we run jMeter.  So, before we
> make a decision on which road to take, I'm trying to
> get my arms around what would be involved with
> extending jMeter to use the csv file directly.
> 
> Can you help?  If so, thanks for any advice/direction
> you can give.
> 
> Dan Yuen
> 
> __________________________________
> Do you Yahoo!?
> Exclusive Video Premiere - Britney Spears
> http://launch.yahoo.com/promos/britneyspears/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 




--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Using csv data as input

Posted by peter lin <jm...@yahoo.com>.
I did some profiling of the new log parser sampler
last week and the performance was decent. the current
parser I wrote is fairly efficient, since it uses
bufferedReader to read one line at a time. Mike's
comments are accurate and new sampler wouldn't be able
to handle assertions and so on.

In the past I wrote a tool to convert netscape log to
jmeter requests, but I ran into a problem because
loading 5-10K requests in a test plan requires 1gig of
ram. If you're dealing with a large number of unique
requests to simulate production traffic, you may be
better off going with the log parser route. If not, a
simple conversion from CSV to jmeter requests is most
likely the best option.

good luck.

peter



--- Dan Yuen <dy...@yahoo.com> wrote:
> We are considering moving our application testing
> over
> to jMeter and are looking at how we would need to
> modify jMeter to fit our company needs. 
> Specifically,
> we have a test generation tool that produces a csv
> file which contains, among other things, inputs for
> test cases (which I'm thinking would convert into
> Samplers) and expected outputs (which I'm thinking
> would get converted into Assertions for those
> Samplers).  
> 
> What would be the best way to convert the csv data
> into Samplers and Assertions?  Are there certain
> classes that can easily be extended so that I can
> read
> a csv file and convert each line into a Sampler with
> associated Assertions and add them to my Test Plan? 
> Or would it be much easier and quicker to just write
> a
> csv to jmx converter?  
> 
> It seems the latter would be quicker in the short
> run
> but would require running the converter as an
> intermediate step before we run jMeter.  So, before
> we
> make a decision on which road to take, I'm trying to
> get my arms around what would be involved with
> extending jMeter to use the csv file directly.
> 
> Can you help?  If so, thanks for any
> advice/direction
> you can give.
> 
> Dan Yuen
> 
> __________________________________
> Do you Yahoo!?
> Exclusive Video Premiere - Britney Spears
> http://launch.yahoo.com/promos/britneyspears/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jmeter-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org