You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Dirk Olmes <di...@xanthippe.ping.de> on 2009/12/10 20:42:42 UTC

assertion after while controller with embedded http sampler?

Hi,

I'm setting up load test scenario for a web app that does HTTP meta 
refresh. The user enters search criteria into a form and upon submit a 
page is returned that has a refresh header, causing the browser to reload.

I'm using a while controller that has a child http sampler to poll the 
refresh URL. I'm using a regex expression extractor to retrieve the 
updated refresh URL from the previous sample.

Now my question: when the "refresh loop" ends and the result page is 
displayed I want to add an assertion that the right page is displayed. 
While I can identify the results page, I have no idea where to put the 
assertion. 

Any ideas?

-dirk



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


Re: assertion after while controller with embedded http sampler?

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
On Fri, 11 Dec 2009 11:41:18 +0000, sebb wrote:

> On 11/12/2009, Dirk Olmes <di...@xanthippe.ping.de> wrote:
>> >>  I'm setting up load test scenario for a web app that does HTTP meta
>>  >>  refresh. The user enters search criteria into a form and upon
>>  >>  submit a page is returned that has a refresh header, causing the
>>  >>  browser to reload.
>>  >>
>>  >>  I'm using a while controller that has a child http sampler to poll
>>  >>  the refresh URL. I'm using a regex expression extractor to
>>  >>  retrieve the updated refresh URL from the previous sample.
>>  >>
>>  >>  Now my question: when the "refresh loop" ends and the result page
>>  >>  is displayed I want to add an assertion that the right page is
>>  >>  displayed. While I can identify the results page, I have no idea
>>  >>  where to put the assertion.
>>  >>
>>  >>  Any ideas?
>>  >
>>  > ...
>>  > Simple Controller
>>  > + While Controller
>>  > + Assertion
>>  >
>>  > This should limit the Assertion to the previous sampler.
>>
>>
>> Thanks, for the tip, unfortunately that doesn't work :-( I have this
>>  right now:
>>
>>  Simple Controller
>>  + While Controller
>>   + Regex extractor for next refresh URL + Assertion (different one,
>>   checks that no error page comes up)
>>  + Assertion (for results page)
>>
>>  If I run this, the while controller ends immediately because the
>>  results page assertion fails.
>>
>>
> Duh! Sorry, forgot that the last assertion would still be in scope for
> the while loop sampler. I don't think it's possible to use an Assertion
> directly for this.
> 
> Try adding another RE in the loop which extracts the desired text; use a
> default value which is different from that.
> 
> The variable will then contain the default on exit from the while loop
> if the RE failed.
> 
> To check for this, you could use either: * a Java Sampler with
> ${variable} in SampleResult + child Assertion * If Controller
> "${variable}" != "default" + child Test Action

Thanks, that's about the same method I figured out and used with success 
now. I added some negated assertions on common error messages, too. 

Thanks for the help,

-dirk


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


Re: assertion after while controller with embedded http sampler?

Posted by sebb <se...@gmail.com>.
On 11/12/2009, Dirk Olmes <di...@xanthippe.ping.de> wrote:
> >>  I'm setting up load test scenario for a web app that does HTTP meta
>  >>  refresh. The user enters search criteria into a form and upon submit a
>  >>  page is returned that has a refresh header, causing the browser to
>  >>  reload.
>  >>
>  >>  I'm using a while controller that has a child http sampler to poll the
>  >>  refresh URL. I'm using a regex expression extractor to retrieve the
>  >>  updated refresh URL from the previous sample.
>  >>
>  >>  Now my question: when the "refresh loop" ends and the result page is
>  >>  displayed I want to add an assertion that the right page is displayed.
>  >>  While I can identify the results page, I have no idea where to put the
>  >>  assertion.
>  >>
>  >>  Any ideas?
>  >
>  > ...
>  > Simple Controller
>  > + While Controller
>  > + Assertion
>  >
>  > This should limit the Assertion to the previous sampler.
>
>
> Thanks, for the tip, unfortunately that doesn't work :-( I have this
>  right now:
>
>  Simple Controller
>  + While Controller
>   + Regex extractor for next refresh URL
>   + Assertion (different one, checks that no error page comes up)
>  + Assertion (for results page)
>
>  If I run this, the while controller ends immediately because the results
>  page assertion fails.
>

Duh! Sorry, forgot that the last assertion would still be in scope for
the while loop sampler. I don't think it's possible to use an
Assertion directly for this.

Try adding another RE in the loop which extracts the desired text; use
a default value which is different from that.

The variable will then contain the default on exit from the while loop
if the RE failed.

To check for this, you could use either:
* a Java Sampler with ${variable} in SampleResult + child Assertion
* If Controller "${variable}" != "default" + child Test Action

>  -dirk
>
>
>  ---------------------------------------------------------------------
>  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: assertion after while controller with embedded http sampler?

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
>>  I'm setting up load test scenario for a web app that does HTTP meta
>>  refresh. The user enters search criteria into a form and upon submit a
>>  page is returned that has a refresh header, causing the browser to
>>  reload.
>>
>>  I'm using a while controller that has a child http sampler to poll the
>>  refresh URL. I'm using a regex expression extractor to retrieve the
>>  updated refresh URL from the previous sample.
>>
>>  Now my question: when the "refresh loop" ends and the result page is
>>  displayed I want to add an assertion that the right page is displayed.
>>  While I can identify the results page, I have no idea where to put the
>>  assertion.
>>
>>  Any ideas?
> 
> ...
> Simple Controller
> + While Controller
> + Assertion
> 
> This should limit the Assertion to the previous sampler.

Thanks, for the tip, unfortunately that doesn't work :-( I have this 
right now:

Simple Controller
+ While Controller
  + Regex extractor for next refresh URL
  + Assertion (different one, checks that no error page comes up)
+ Assertion (for results page)

If I run this, the while controller ends immediately because the results 
page assertion fails.

-dirk


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


Re: assertion after while controller with embedded http sampler?

Posted by sebb <se...@gmail.com>.
On 10/12/2009, Dirk Olmes <di...@xanthippe.ping.de> wrote:
> Hi,
>
>  I'm setting up load test scenario for a web app that does HTTP meta
>  refresh. The user enters search criteria into a form and upon submit a
>  page is returned that has a refresh header, causing the browser to reload.
>
>  I'm using a while controller that has a child http sampler to poll the
>  refresh URL. I'm using a regex expression extractor to retrieve the
>  updated refresh URL from the previous sample.
>
>  Now my question: when the "refresh loop" ends and the result page is
>  displayed I want to add an assertion that the right page is displayed.
>  While I can identify the results page, I have no idea where to put the
>  assertion.
>
>  Any ideas?

...
Simple Controller
+ While Controller
+ Assertion

This should limit the Assertion to the previous sampler.


>  -dirk
>
>
>
>  ---------------------------------------------------------------------
>  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