You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by COGOLUEGNES Arnaud <AC...@aston.fr> on 2005/05/03 11:57:39 UTC

Regex extractor and if controller

Hi all,

I'm trying to do the following in web test plan: from request A, I retrieve
object ids with a regex post-processor and I re-inject a random id value in
the following request (B). It works perfectly and give some realism to the
test plan. But sometimes, the object list can be empty in request A, so no
id can be retrieved and request B becomes useless. I wanted to add a
IF-controller before request B, to test the value of the variable containing
the id, let's say ${id}, and skip B if ${id} is equal to the regex extractor
default value. I put this code in the IF condition:

${id} != -1    (-1 is the default value)

but B is always exectuted. First, I thought about the condition syntax but I
tested with a user variable defined in the test plan and it looked ok. So I
thought about a scope issue. Is the extracted value visible for the
IF-controller?

Any help is welcome, hope my explanations are clear.

Regards,

Arno

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


Re: Regex extractor and if controller

Posted by sebb <se...@gmail.com>.
If it is a scope issue, try adding a simple controller as parent of
the If controller.

e.g.

Sample 1
- Regex
Simple Controller
- If Controller
- - Sample 2

S.
On 5/3/05, COGOLUEGNES Arnaud <AC...@aston.fr> wrote:
> Hi all,
> 
> I'm trying to do the following in web test plan: from request A, I retrieve
> object ids with a regex post-processor and I re-inject a random id value in
> the following request (B). It works perfectly and give some realism to the
> test plan. But sometimes, the object list can be empty in request A, so no
> id can be retrieved and request B becomes useless. I wanted to add a
> IF-controller before request B, to test the value of the variable containing
> the id, let's say ${id}, and skip B if ${id} is equal to the regex extractor
> default value. I put this code in the IF condition:
> 
> ${id} != -1    (-1 is the default value)
> 
> but B is always exectuted. First, I thought about the condition syntax but I
> tested with a user variable defined in the test plan and it looked ok. So I
> thought about a scope issue. Is the extracted value visible for the
> IF-controller?
> 
> Any help is welcome, hope my explanations are clear.
> 
> Regards,
> 
> Arno
> 
> ---------------------------------------------------------------------
> 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