You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Yiping Yang <Yi...@icims.com> on 2006/02/27 20:55:19 UTC

how to accumulate variables

Hi all,

I met a little bit interesting problem. From Http response data, I get data
string like that.

<td id='e31' col="0" outputType='FreeText'>47</td> 
<td id='e31' col="0" outputType='FreeText'>63</td> 
<td id='e31' col="0" outputType='FreeText'>49</td> 
<td id='e31' col="0" outputType='FreeText'>50</td>

I use "Regular Expression Extractor" to get the number between <td> tags.
The problem is I want to get all these numbers and format them into a string
like that: "47,63,49,50". 

I tried to use Expression Extractor" to get these numbers. (set Match No.
-1), then I use " For Each " controller. But I don't know which component I
can use inside the for each loop to accumulate the variables. I tried "User
Defined Variables", but it resets the value in each loop. 

Any solutions?

Thank,
yiping

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


Re: how to accumulate variables

Posted by sebb <se...@gmail.com>.
If you know how many matches there are, then you can just refer to
their variable names.

e.g.

${VAR_1_g1},${VAR_2_g1},${VAR_3_g1},${VAR_4_g1}

Otherwise, it would be possible to write a BeanShell function to loop
over the variables.

S.
On 27/02/06, Yiping Yang <Yi...@icims.com> wrote:
> Hi all,
>
> I met a little bit interesting problem. From Http response data, I get data
> string like that.
>
> <td id='e31' col="0" outputType='FreeText'>47</td>
> <td id='e31' col="0" outputType='FreeText'>63</td>
> <td id='e31' col="0" outputType='FreeText'>49</td>
> <td id='e31' col="0" outputType='FreeText'>50</td>
>
> I use "Regular Expression Extractor" to get the number between <td> tags.
> The problem is I want to get all these numbers and format them into a string
> like that: "47,63,49,50".
>
> I tried to use Expression Extractor" to get these numbers. (set Match No.
> -1), then I use " For Each " controller. But I don't know which component I
> can use inside the for each loop to accumulate the variables. I tried "User
> Defined Variables", but it resets the value in each loop.
>
> Any solutions?
>
> Thank,
> yiping
>
> ---------------------------------------------------------------------
> 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