You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sebb <se...@gmail.com> on 2006/11/02 15:22:03 UTC

Re: CSV Data Config Help

On 31/10/06, Inquisitor65 <pa...@hotmail.com> wrote:
>
> I am trying to test an HTTP API by defining a list of test requests in a "CSV
> Data Set Config" and submitting to the API using an "HTTP Request" sampler.
>
> Problem I am having is that the entries in the CSV file contain embedded
> parameters, example :
>
> http://<server-address/webapp/<servlet-name>?DATE1=${DATE1}&DATE2=${DATE2}
>
> I was hoping to set the values for these parameters in a "User Define
> Variables" element and then have them expanded automatically. However this
> doesn't occur. The requests that are being submitted as the example above
> without substitution of variable names for values.
>
> Any idea how I can get this to work?

Not possible as it stands without writing some Java code.

Both the parameter name and the value can be variables (on the HTTP
Sampler), so you can define the names in the CSV file, and the values
in the  UDV.

For example, add the following to the Sampler:

Name       Value
${P1N}     ${P1V}
${P2N}     ${P2V}

The variables P1N and P2N can then be defined as DATE1 and DATE2 in
the CSV file, and the values defined in the UDV.

If you have a varying number of parameters, you may be able to get
round this by setting the unused parameters to dummy values, or just
repeat one of the parameters - this depends a bit on how the server
interprets the parameter list.

If the parameter name and value are set to the empty string, then the
URL will look something like

?P1=V1&=

which may perhaps be ignored by the server...

==

Might be useful to enhance JMeter so that parameter names that are
empty (after evaluation) are ignored. This would allow one to define
an HTTP Sampler with the maximum number of parameters, and just define
the ones that are needed.

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