You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Kate Rosenbloom <ka...@rapidmoney.com> on 2002/04/09 02:01:27 UTC
Using variables in HTTP and JDBC requests
I recently used JMeter to test a servlet, where I needed to have
each test thread generate a unique test sample (the first thread would
create "Test Customer 1", and the second thread would create "Test
Customer 2", etc.).
Also, I needed this unique number to be used in both the web requests
(where the
data record was created), and in JDBC requests that I used to clean up
the
database after testing.
To do this, I implemented a Modifier, called ThreadNumberModifier. It
will substitute in the numeric ID of the currently executing thread
anywhere it
sees the text tag $$JMETER-THREAD$$ in any HTTP request (parameters or
path) or
JDBC request (the query) it processes.
The prefix $$JMETER- is handled by a superclass of ThreadNumberModifier,
so
it would be easy to add other variable-substituting modifiers, such as
for
random numbers, email addressses from a list, etc. (I think I've seen
requests
for these in this mailing list).
If other folks think this would be generally useful, let me know, and I
will
submit the code to the developers list for consideration.
Kate Rosenbloom
RapidMoney Corp.
Santa Cruz, CA
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>