You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bob Nance <bo...@novationsys.com> on 2015/04/16 22:51:13 UTC

Need to insert a variable into the head of a POST

I have extracted the value of a token from meta data sent by a form and put that into a reference variable. Now, I need to put that variable into a value pair in the head of the POST that follows.

I thought I could just go to the script, into the "HTTP Header Manager” and add a line that says:

   X-MYTOKEN		${mytoken}

But, when I do that, jmeter sends the literal “${mytoken}” in the HEAD.

What am I doing wrong?

-Bob


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

Re: Need to insert a variable into the head of a POST

Posted by Sergio Boso <se...@bosoconsulting.it>.
Il 16/04/2015 22.51, Bob Nance ha scritto:
> I have extracted the value of a token from meta data sent by a form and put that into a reference variable. Now, I need to put that variable into a value pair in the head of the POST that follows.
>
> I thought I could just go to the script, into the "HTTP Header Manager” and add a line that says:
>
>     X-MYTOKEN		${mytoken}
>
> But, when I do that, jmeter sends the literal “${mytoken}” in the HEAD.
>
> What am I doing wrong?
This means the variable is not defined.
Check the name, remember it is case sensitive.

regards

> r additional commands, e-mail: user-help@jmeter.apache.org


-- 




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


RE: Need to insert a variable into the head of a POST

Posted by Erez Naim <er...@theneura.com>.
Hi Bob,

Are you trying to extract the value and use it in the same thread group? In case you try to use it in another thread group  you have to make a pre-step before using it.

BR,

Erez

-----Original Message-----
From: Bob Nance [mailto:bob.nance@novationsys.com] 
Sent: Thursday, April 16, 2015 11:51 PM
To: JMeter Users List
Subject: Need to insert a variable into the head of a POST

I have extracted the value of a token from meta data sent by a form and put that into a reference variable. Now, I need to put that variable into a value pair in the head of the POST that follows.

I thought I could just go to the script, into the "HTTP Header Manager” and add a line that says:

   X-MYTOKEN		${mytoken}

But, when I do that, jmeter sends the literal “${mytoken}” in the HEAD.

What am I doing wrong?

-Bob


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


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


Re: Need to insert a variable into the head of a POST

Posted by Deepak Shetty <sh...@gmail.com>.
works for me - did u verify using a debug sampler?

On Thu, Apr 16, 2015 at 1:51 PM, Bob Nance <bo...@novationsys.com>
wrote:

> I have extracted the value of a token from meta data sent by a form and
> put that into a reference variable. Now, I need to put that variable into a
> value pair in the head of the POST that follows.
>
> I thought I could just go to the script, into the "HTTP Header Manager”
> and add a line that says:
>
>    X-MYTOKEN            ${mytoken}
>
> But, when I do that, jmeter sends the literal “${mytoken}” in the HEAD.
>
> What am I doing wrong?
>
> -Bob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>