You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Karsten Gaul <ka...@exedio.com> on 2010/06/28 10:27:15 UTC

Switch request method dynamically

Hi,

what I would like to do is get the HTTPRequest method (POST, GET) 
dynamically from a csv file which I created. The reason is that I want 
to replay recorded data including many different paths and variables on 
the same host. I used the CSV Config Element, only one HTTPRequest, and 
as many iterations in the thread group as I have rows in the csv. This 
works fine except for the request method because it has a combo box 
where I cannot insert variable names.

Any Ideas?

rgds,
Karsten

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


Re: Switch request method dynamically

Posted by Thibaut Raballand <th...@gmail.com>.
Hi,

Or you can put a beanshell common preprocessor to all your HTTP requests.
In this one, according to the variable retrieved in your CSV, you change the
method of the coming sampler with setMethod(string).

See in API : http://jakarta.apache.org/jmeter/api/index.html

regards,
Tibo

2010/6/28 Andrey Pohilko <ap...@fininfor.ru>

> Hi,
>
> Just use 2 samplers, one making GET request, another making POST. Use
> controllers if needed. It will be the most efficient way in your case.
>
>
> С уважением,
> Андрей Похилько
> -----Original Message-----
> From: Karsten Gaul [mailto:karsten.gaul@exedio.com]
> Sent: Monday, June 28, 2010 12:27 PM
> To: jmeter-user@jakarta.apache.org
> Subject: Switch request method dynamically
>
> Hi,
>
> what I would like to do is get the HTTPRequest method (POST, GET)
> dynamically from a csv file which I created. The reason is that I want
> to replay recorded data including many different paths and variables on
> the same host. I used the CSV Config Element, only one HTTPRequest, and
> as many iterations in the thread group as I have rows in the csv. This
> works fine except for the request method because it has a combo box
> where I cannot insert variable names.
>
> Any Ideas?
>
> rgds,
> Karsten
>
> ---------------------------------------------------------------------
> 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
>
>

RE: Switch request method dynamically

Posted by Andrey Pohilko <ap...@fininfor.ru>.
Hi,

Just use 2 samplers, one making GET request, another making POST. Use
controllers if needed. It will be the most efficient way in your case.

 
С уважением,
Андрей Похилько
-----Original Message-----
From: Karsten Gaul [mailto:karsten.gaul@exedio.com] 
Sent: Monday, June 28, 2010 12:27 PM
To: jmeter-user@jakarta.apache.org
Subject: Switch request method dynamically

Hi,

what I would like to do is get the HTTPRequest method (POST, GET) 
dynamically from a csv file which I created. The reason is that I want 
to replay recorded data including many different paths and variables on 
the same host. I used the CSV Config Element, only one HTTPRequest, and 
as many iterations in the thread group as I have rows in the csv. This 
works fine except for the request method because it has a combo box 
where I cannot insert variable names.

Any Ideas?

rgds,
Karsten

---------------------------------------------------------------------
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