You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sv...@sva.sozvers.at on 2006/05/04 09:28:23 UTC

DB-Query in a PreProcessor

Dear Community!

I have the following situation in a workflow-centric web application:

For the execution of the normal (user controlled) workflow a transaction_id
is needed which is assigned by the application (querying a database). It is
then stored in a bean and sent with every request. I have recorded this
workflow in JMeter. The problem now is that JMeter of course sends the
recorded transaction_id (which is a primary key, so unique) and not the
next available one. Therefore I need to do a database query before starting
the actual workflow test and store it somewhere (where?) from where it can
be accessed as a variable .

How can I do this? My first idea was to use a pre-processor, but there is
no possibility to do database queries there, is it?

Any help is appreciated.

Thanks,
Sven


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


Re: DB-Query in a PreProcessor

Posted by sebb <se...@gmail.com>.
You can extract information from a response using the Regex extractor
Post-Processor

So just add the appropriate JDBC request, and refer to the variable as ${ID}

Or you can extract the id indepently, and pass it in as a property on
the command line:

jmeter .... -Jid=12345

refer to ${__P(id)} in the test plan.

Or save it in a file, and use CSV Data Set.

S.
On 04/05/06, Sven.Huber@sva.sozvers.at <Sv...@sva.sozvers.at> wrote:
> Dear Community!
>
> I have the following situation in a workflow-centric web application:
>
> For the execution of the normal (user controlled) workflow a transaction_id
> is needed which is assigned by the application (querying a database). It is
> then stored in a bean and sent with every request. I have recorded this
> workflow in JMeter. The problem now is that JMeter of course sends the
> recorded transaction_id (which is a primary key, so unique) and not the
> next available one. Therefore I need to do a database query before starting
> the actual workflow test and store it somewhere (where?) from where it can
> be accessed as a variable .
>
> How can I do this? My first idea was to use a pre-processor, but there is
> no possibility to do database queries there, is it?
>
> Any help is appreciated.
>
> Thanks,
> Sven
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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