You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ma...@desjardins.com on 2008/08/22 17:38:22 UTC
While loop controller question
Hello all,
I am writing a testing scenario for a complex banking app, using jmeter of
course.
So far I manage to log on and navigate through the app with no problems.
However, at some point
I have a temporary page which is displayed while a mainframe transaction
is being performed.
This temporary page loops back to itself every 5 seconds (via javascript)
until the MF transaction
is complete....then it continues and displays the intended data.
My problem stems from trying to get past this page using JMeter. Here is
how I've set it up:
****** snip ******
Http Request 1
Http Request 2
While Controller (not sure of the syntax here, but I would like it
to be something like: SequenceValue <> 5 and don't loop more than 10
times)
Http Request 3
Regular expression extractor (ref name:
SequenceValue, regex: noSeq=(\d{1}), Template: $1$, Match: 0, Default:
NOT FOUND)
Http Request 4
********************
Note: each page returns a sequence number in the html (noSeq=x), and the
temporary page keeps returning noSeq=4, hence
when the transaction is completed I receive a page with noSeq=5
Some questions:
1) Is this a good approach to get past this kind of contruct in our
webapp?
2) SequenceValue keeps returning NOT FOUND .... (yet, SequenceValue_1=5),
why is the variable not affected properly?
3) Can someone suggest the syntax for my while controller's condition?
Thanks in advance!!
Mark
Re: While loop controller question
Posted by sebb <se...@gmail.com>.
On 25/08/2008, Farid Vaswani <f....@auckland.ac.nz> wrote:
> I think you cannot specify comparisons in the While loop condition
> itself.
Yes you can:
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#While_Controller
> Either you call a function or use a variable to control it - and it will
> run until the specified variable is 'true' or unless a function returns
> 'true'
No, the While Controller looks for "false".
> In your case have an If condition after the Regex extractor ie. If a
> variable_value==5 then bVariable = false
> And specify the bVariable in the 'while' loop.
>
Or just use:
${__javaScript(${variable_value}==5)}
as the While Condition.
> HTH.
>
> Cheers,
> Farid
>
>
>
> -----Original Message-----
> From: mark.cote@desjardins.com [mailto:mark.cote@desjardins.com]
> Sent: Saturday, 23 August 2008 03:38
> To: jmeter-user@jakarta.apache.org
> Subject: While loop controller question
>
> Hello all,
>
> I am writing a testing scenario for a complex banking app, using jmeter
> of
> course.
>
> So far I manage to log on and navigate through the app with no problems.
>
> However, at some point
> I have a temporary page which is displayed while a mainframe transaction
>
> is being performed.
> This temporary page loops back to itself every 5 seconds (via
> javascript)
> until the MF transaction
> is complete....then it continues and displays the intended data.
>
> My problem stems from trying to get past this page using JMeter. Here is
>
> how I've set it up:
>
>
> ****** snip ******
>
> Http Request 1
>
> Http Request 2
>
> While Controller (not sure of the syntax here, but I would like
> it
> to be something like: SequenceValue <> 5 and don't loop more than 10
> times)
> Http Request 3
> Regular expression extractor (ref name:
> SequenceValue, regex: noSeq=(\d{1}), Template: $1$, Match: 0,
> Default:
> NOT FOUND)
>
> Http Request 4
>
> ********************
>
> Note: each page returns a sequence number in the html (noSeq=x), and the
>
> temporary page keeps returning noSeq=4, hence
> when the transaction is completed I receive a page with noSeq=5
>
>
>
> Some questions:
>
> 1) Is this a good approach to get past this kind of contruct in our
> webapp?
> 2) SequenceValue keeps returning NOT FOUND .... (yet,
> SequenceValue_1=5),
> why is the variable not affected properly?
> 3) Can someone suggest the syntax for my while controller's condition?
>
>
> Thanks in advance!!
>
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> 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
RE: While loop controller question
Posted by Farid Vaswani <f....@auckland.ac.nz>.
I think you cannot specify comparisons in the While loop condition
itself.
Either you call a function or use a variable to control it - and it will
run until the specified variable is 'true' or unless a function returns
'true'
In your case have an If condition after the Regex extractor ie. If a
variable_value==5 then bVariable = false
And specify the bVariable in the 'while' loop.
HTH.
Cheers,
Farid
-----Original Message-----
From: mark.cote@desjardins.com [mailto:mark.cote@desjardins.com]
Sent: Saturday, 23 August 2008 03:38
To: jmeter-user@jakarta.apache.org
Subject: While loop controller question
Hello all,
I am writing a testing scenario for a complex banking app, using jmeter
of
course.
So far I manage to log on and navigate through the app with no problems.
However, at some point
I have a temporary page which is displayed while a mainframe transaction
is being performed.
This temporary page loops back to itself every 5 seconds (via
javascript)
until the MF transaction
is complete....then it continues and displays the intended data.
My problem stems from trying to get past this page using JMeter. Here is
how I've set it up:
****** snip ******
Http Request 1
Http Request 2
While Controller (not sure of the syntax here, but I would like
it
to be something like: SequenceValue <> 5 and don't loop more than 10
times)
Http Request 3
Regular expression extractor (ref name:
SequenceValue, regex: noSeq=(\d{1}), Template: $1$, Match: 0,
Default:
NOT FOUND)
Http Request 4
********************
Note: each page returns a sequence number in the html (noSeq=x), and the
temporary page keeps returning noSeq=4, hence
when the transaction is completed I receive a page with noSeq=5
Some questions:
1) Is this a good approach to get past this kind of contruct in our
webapp?
2) SequenceValue keeps returning NOT FOUND .... (yet,
SequenceValue_1=5),
why is the variable not affected properly?
3) Can someone suggest the syntax for my while controller's condition?
Thanks in advance!!
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org