jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: Using values from DB for a HTTP request
Date Sat, 04 Jun 2011 08:42:18 GMT
the simple answer is to use a CSV file instead (Im assuming eventually you
will want to run your test with multiple threads and this user name will
vary per thread).

Then you simply use the CSV Data Set config . In the variable name field you
specify say username,password (number of variables is same as number of
columns in your CSV) and in your HTTP request you use ${username} and
${password} wherever you want to post the value.
various comments in the mail archives describe this

You can ofcourse use various techniques to generate this CSV (including
generating it from within Jmeter, but usually this is done outside the test)
-


If you still wanted to answer your original question then
+Threadgroup
++JDBC Connection Configuration (db settings, datasource name)
++JDBC Request Sampler (uses above datasource, in the variable names field
specify any names (number should be same as columns returned by sql - e.g.
username,password
++Debug Sampler (to validate what is being returned , you can remove once
you get it working
++HTTP Sampler (use ${username} and ${password} for parameter values -
assuming only 1 row is returned
+View Results tree listener

if you database stores password in anything other than a one way salted hash
then you have a serious security risk.

regards
deepak

On Sat, Jun 4, 2011 at 1:26 AM, pavelz <zagalsky@gmail.com> wrote:

> Hi guys, I'm a n00b here so I'd really appreciate your help on some small
> thing:
> I need to extract from DB a user and a password in order to pass them as
> parameters within HTTP request.
> For some reason what I do at the moment I fail miserably.
> Many thanks in advance!
> Pavel
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Using-values-from-DB-for-a-HTTP-request-tp4453447p4453447.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message