jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Assertion to compare two numbers
Date Wed, 19 Oct 2005 09:51:01 GMT
The If Controller assumes JavaScript - do not enclose the condition in
the __Javascript() function.

Anyway, would it not be enough to put the following?

${include_tax_price} <= ${exclude_tax_price}

==

Or you could make your own assertion based on the Size Assertion.

S.
On 19/10/05, Sonam Chauhan <sonam.chauhan@ce.com.au> wrote:
> Thanks a lot Sebb. I think I can't use a Beanshell assertion. The JMeter
> version we're currently frozen at is 1.9.1 (we version control it along with
> the testcases - otherwise things break :)
>
> I was playing with an 'If controller' with this condition:
> ${__javaScript( if (  ${include_tax_price} <= ${exclude_tax_price})
>                        {return true} else {return false},)}
> The idea was to go down the if statement if the assertion failed, and then
> hit an "impossible" URL like http://abcd:123456/
>
> On second thoughts, this is nasty. :-P I'll wait until we upgrade JMeter.
>
> Regards,
> Sonam
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, 18 October 2005 8:32 PM
> To: JMeter Users List
> Subject: Re: Assertion to compare two numbers
>
> This is a job for an Assertion.
>
> The BeanShell Assertion is currently the only Assertion that can
> perform such checks currently:
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShe
> ll_Assertion
>
> Have a look at the sample.
>
> S.
> On 18/10/05, Sonam Chauhan <sonam.chauhan@ce.com.au> wrote:
> > Hello - I'm a bit lost here :-)
> >
> >
> >
> > My test needs to verify "include-tax" settings were obeyed when
> calculating
> > price. Since prices will vary with time, I can't use hardcoded response
> > assertions. So my test plan logs into two accounts  - one set to include
> > tax, and one not to. Prices of the same item are then obtained and
> compared
> > -- the include_tax price must be higher.
> >
> >
> >
> > I obtained the prices into two JMeter variables using the 'Regular
> > Expression Extractor' post-processor.
> >
> >
> >
> > But how can the script compare these two variables? (i.e. return failure
> if
> > the include_tax price is not higher than exclude_tax price)
> >
> >
> >
> > Sincerely,
> >
> > Sonam Chauhan
> >
> > --
> >
> > Corporate Express Australia Ltd.
> >
> > Phone: +61-2-9335-0725, Email: sonam.chauhan@ce.com.au
> > <mailto:sonam.chauhan@ce.com.au>
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>

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


Mime
View raw message