You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ashamaniq <as...@gmail.com> on 2009/07/22 22:45:21 UTC

How do I load variables into a HTTP request?

Good day!
I'm just starting to use Jmeter and so far it's been going well but I'm
having trouble or don't know exactly where to start with loading variables
into a HTTP POST.

Basically I need to send a different HEX value in my path with each new
request I send to my server.

Path: /procdac/settings.pr?x=3&cod=12&m=000011AA22BB

m= MAC Address, which should be random.

Or is there is a way to pull "m=$mac_var" from a text file with a list of
MAC addresses.
I tried specify a CVS file using CSV Data Set Config, but I'm not sure how I
can make a reference from my Path to that variable.

Any suggestions?

Thanks!
-- 
View this message in context: http://www.nabble.com/How-do-I-load-variables-into-a-HTTP-request--tp24614231p24614231.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


Re: How do I load variables into a HTTP request?

Posted by ashamaniq <as...@gmail.com>.
Thanks Deepak,
That worked.



Deepak Shetty wrote:
> 
> Hi
> For e.g.
> If your CSV file has two fields
> In the variable names field say you type mac_var,another_var
> Then in your HTTP Sampler you can type ${mac_var} and at runtime the value
> will get replaced.
> This could  be in the value field of the Sampler (name field would be m,
> however your example is showing the parameter in the URL which is normally
> a
> get)
> 
> If you can calculate this value at runtime say using java code , you can
> use
> a preprocessor to populate the variables. The HTTP Sampler would remain
> the
> same
> 
> regards
> deepak
> 
> On Wed, Jul 22, 2009 at 1:45 PM, ashamaniq <as...@gmail.com> wrote:
> 
>>
>> Good day!
>> I'm just starting to use Jmeter and so far it's been going well but I'm
>> having trouble or don't know exactly where to start with loading
>> variables
>> into a HTTP POST.
>>
>> Basically I need to send a different HEX value in my path with each new
>> request I send to my server.
>>
>> Path: /procdac/settings.pr?x=3&cod=12&m=000011AA22BB
>>
>> m= MAC Address, which should be random.
>>
>> Or is there is a way to pull "m=$mac_var" from a text file with a list of
>> MAC addresses.
>> I tried specify a CVS file using CSV Data Set Config, but I'm not sure
>> how
>> I
>> can make a reference from my Path to that variable.
>>
>> Any suggestions?
>>
>> Thanks!
>> --
>> View this message in context:
>> http://www.nabble.com/How-do-I-load-variables-into-a-HTTP-request--tp24614231p24614231.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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-do-I-load-variables-into-a-HTTP-request--tp24614231p24615264.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


Re: How do I load variables into a HTTP request?

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
For e.g.
If your CSV file has two fields
In the variable names field say you type mac_var,another_var
Then in your HTTP Sampler you can type ${mac_var} and at runtime the value
will get replaced.
This could  be in the value field of the Sampler (name field would be m,
however your example is showing the parameter in the URL which is normally a
get)

If you can calculate this value at runtime say using java code , you can use
a preprocessor to populate the variables. The HTTP Sampler would remain the
same

regards
deepak

On Wed, Jul 22, 2009 at 1:45 PM, ashamaniq <as...@gmail.com> wrote:

>
> Good day!
> I'm just starting to use Jmeter and so far it's been going well but I'm
> having trouble or don't know exactly where to start with loading variables
> into a HTTP POST.
>
> Basically I need to send a different HEX value in my path with each new
> request I send to my server.
>
> Path: /procdac/settings.pr?x=3&cod=12&m=000011AA22BB
>
> m= MAC Address, which should be random.
>
> Or is there is a way to pull "m=$mac_var" from a text file with a list of
> MAC addresses.
> I tried specify a CVS file using CSV Data Set Config, but I'm not sure how
> I
> can make a reference from my Path to that variable.
>
> Any suggestions?
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/How-do-I-load-variables-into-a-HTTP-request--tp24614231p24614231.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
>
>