You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Dean Lozo <de...@gmail.com> on 2012/07/03 10:20:41 UTC

Overwriting a variable.

Hey

I have a JMeter script and this is my current issue:

1. I extract a value from a response body that gets set to the variable
${room_name_g1}.

2. I perform a search.

3. I extract the ID, folder type, and room location. The room location gets
set to the value ${search_result_ID_g3}.

4. I then navigate using the ${room_name_g1} variable in the URL.

In order to avoid duplicates, inconsistencies and a complete mess i wish to
change the value of ${room_name_g1} to ${search_result_ID_g3}.

*Question:* Is there a sampler/tool or anyting that allows me to change
variable value before using a sampler, or should I simply change the output
variable to "room_name" on the extractor that I use in step 3 so it matches
step 1?

Cheers
Dean

Re: Overwriting a variable.

Posted by Dean Lozo <de...@gmail.com>.
I just realised that setting the variable name to room_name on step 3 would
not solve anything. The variable would still be a different variable:
( ${room_name_g3}
)

>

Re: Overwriting a variable.

Posted by Dean Lozo <de...@gmail.com>.
Thanks, i will look into that :)
On Jul 3, 2012 11:19 AM, "ZK" <st...@gmail.com> wrote:

> Hi,
> you could use a beanshell post processor with this code:
>
> temp = vars.get("search_result_ID_g3");
> vars.put("room_name_g1", temp);
>
>
>
> ZK
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Overwriting-a-variable-tp5713805p5713809.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Overwriting a variable.

Posted by ZK <st...@gmail.com>.
Hi,
you could use a beanshell post processor with this code:

temp = vars.get("search_result_ID_g3");
vars.put("room_name_g1", temp);



ZK

--
View this message in context: http://jmeter.512774.n5.nabble.com/Overwriting-a-variable-tp5713805p5713809.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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