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/04/29 09:01:02 UTC

Regex post-processor and If controller

Hi all,

I've been trying to do the following in a web application test plan:
retrieve object ids from a list in HTML code with a regex post-processor and
re-inject a random id in the next request. It works perfectly except that
sometimes the list in the first request is empty so no id can be retrieved.
I tried to handle the next request with a If controller (execute the request
only if the id is different from the regex extractor default value) but it
seems the condition cannot retrieve the variable. I put this code in the if
condition (-1 is the default value):

${id} != -1 

but the request is always executed, even when no id has been retrieved. Is
the Javascript condition wrong? I was also wondering if there was a scope
issue, that is the variable set by the regex extractor was not accessible
from the IF controller.

Any help is welcome.

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 post-processor and If controller

Posted by sebb <se...@gmail.com>.
Perhaps try

'${id}' != '-1'

Otherwise, change the RE so that it does not match empty list items.

S.
On 4/29/05, COGOLUEGNES Arnaud <AC...@aston.fr> wrote:
> Hi all,
> 
> I've been trying to do the following in a web application test plan:
> retrieve object ids from a list in HTML code with a regex post-processor and
> re-inject a random id in the next request. It works perfectly except that
> sometimes the list in the first request is empty so no id can be retrieved.
> I tried to handle the next request with a If controller (execute the request
> only if the id is different from the regex extractor default value) but it
> seems the condition cannot retrieve the variable. I put this code in the if
> condition (-1 is the default value):
> 
> ${id} != -1
> 
> but the request is always executed, even when no id has been retrieved. Is
> the Javascript condition wrong? I was also wondering if there was a scope
> issue, that is the variable set by the regex extractor was not accessible
> from the IF controller.
> 
> Any help is welcome.
> 
> 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