jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: advice on using regex to retrieve parameters returned from a java request sampler
Date Thu, 15 Jan 2009 12:51:16 GMT
On 15/01/2009, gregorypeace@aol.com <gregorypeace@aol.com> wrote:
> Hi all - it's great to be back using JMeter :-)
>
>
>
>
>  A few years back we extended JMeter writing an EJB sampler based upon the Java request
sampler.  Our results were outputted in CSV format. We needed to save a number of bespoke
values within our EJB/ Java request samplers and used the following sample results attributes:
responseMessage, reponseCode, datatype and bytes. I suspect this was foolish and I should
have used something else. Any advice would be appreciated. What's the best approach for saving
such bespoke values and then writing them to the CSV/JTL output?
>
>

Other samplers return all the data in the sample itself, and JMeter
uses Regex or XPath Post-Processors to retrieve the information as
required.

So long as the data is reasonably well-laid out, this is quite easy to do.
In the case of the EJB sampler, perhaps it could have returned data in
XML format.

Another approach (not necessarily better) is to save some values in
variables, and use the new variable-saving functionality:

http://jakarta.apache.org/jmeter/usermanual/listeners.html#sample_variables

>
>
>  It all worked for the purpose of that project. However, I now need to follow each of
my EJB requests with an HTTP request which passes those values stored in the above attributes.
Is this possible?

Depends on which field you used. The RE Post-Processor only applies to

Body, Headers, URL, Response Code, Response Message

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Regular_Expression_Extractor

If you are prepared to write some Java you could of course use the
BeanShell Post-Processor to do anything you want, including accessing
dataType. But BeanShell can use a lot more resources.

> From what I've read I need to add a child regular expression extractor to each EJB request,
however I don't know what syntax I should be using in the regular expression component to
retrieve sampleresult attributes.

You can only access the attributes (fields) as per the "Response Field
to check".

REs can be used to extract all or part of the selected field, exactly
as for HTTP samples.

> I'm also concerned as I can only see some of my attributes in sampler result tab of my
view result tree listener.Could this be because I've overridden the dataType attribute on
the sampleresult ?
>

Probably.

>
>
>
>  Any help is really appreciated.
>
>
>
>
>
>  Thanks
>
>
>
>
>
>  Greg Peace
>
>
>  ________________________________________________________________________
>  AOL Email goes Mobile! You can now read your AOL Emails whils
>  t on the move. Sign up for a free AOL Email account with unlimited storage today.
>

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


Mime
View raw message