You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sonam Chauhan <so...@ce.com.au> on 2005/10/18 09:12:35 UTC

Assertion to compare two numbers

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
<ma...@ce.com.au> 

 


Re: Assertion to compare two numbers

Posted by sebb <se...@gmail.com>.
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#BeanShell_Assertion

Have a look at the sample.

S.
On 18/10/05, Sonam Chauhan <so...@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
> <ma...@ce.com.au>
>
>
>
>
>

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