Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » How to do a "sum" of two variables?
How to do a "sum" of two variables? [message #1066205] Mon, 01 July 2013 14:33 Go to next message
Richard Skoog is currently offline Richard SkoogFriend
Messages: 48
Registered: October 2011
Member
Hi,

I want to check that a value is equal to the sum of two variables. Anyone who knows how to do this?

I have tried a "checkSelectionByValue" where the text to check is $VAR1+$VAR2, but it doesn't summarize and check the value of the sum. Maybe I have to add them together first into a third variable, but how shall that be done in that case?

Regards Richard
Re: How to do a "sum" of two variables? [message #1066210 is a reply to message #1066205] Mon, 01 July 2013 14:52 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 357
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

You can do this by using functions - which are started with a question mark. Just try it by typing ? in the parameter field and do a text completion (ctrl space).

Your requirement would be solved by

?add($VAR1,$VAR2)

There are only a few basic functions predefined, but it's a trivial task to implement a some more (if you can write Java code). We are always looking for people contributing generally useful functions, i.e. not something specially tuned for your project.

- Achim
Re: How to do a "sum" of two variables? [message #1066226 is a reply to message #1066210] Mon, 01 July 2013 15:24 Go to previous messageGo to next message
Richard Skoog is currently offline Richard SkoogFriend
Messages: 48
Registered: October 2011
Member
Thanks!

It almost solved my problem. The "add" works great, but the sum is given with a decimal which isn't equivalent with the non decimal integer I want to check towards. Any suggestion of getting none decimal or removing it afterwards the adding is done.

Regards Richard
Re: How to do a "sum" of two variables? [message #1066231 is a reply to message #1066226] Mon, 01 July 2013 15:40 Go to previous message
Richard Skoog is currently offline Richard SkoogFriend
Messages: 48
Registered: October 2011
Member
I solved it myself by doing: ?round(toRound,precision) with precision 0.

Thanks!
Previous Topic:Observation mode vs Object mapping
Next Topic:AUT persist in memory after testsuite ?
Goto Forum:
  


Current Time: Wed Dec 17 19:57:11 GMT 2014

Powered by FUDForum. Page generated in 0.01724 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software