Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Loop and event handler
icon8.gif  Loop and event handler [message #1744697] Thu, 29 September 2016 14:35 Go to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
Hi,

I have a tree component.
For one parent node, I would like to select each child, get the price and make the sum.
At the end the sum of the children price must be equal to the parent node price.

Let say I limit my case to 3 children max.

Here is my test case

Test case: Main
- Select parent node
- Store the parent node price
- Call test case: "Calculate my children price"
- Check Parent Node price = Children Node price


Test Case: "Calculate my children price"
init price child1:0
init price child2:0
init price child3:0
Select Child 1
store price Child 1
Select Child 2
store price Child 2
Select Child 3
store price Child 3
Event Handler: check: sum children price = parent price
Event type : return

Of course if I have 2 nodes only, the event handler is called.
Whatever I will do, finally, the reporting says that the test failed?

So What I do not understand is The test result report.
As you understand when the event handler is called, it is not a real error.
I want just that my test case returns.
Then I check the values, even if the check is ok, the testing report says that the test case failed, cause of course the event handler was detected.

So????
I don't understand how to manage such simple loop, and finally get ok "Test case success, the sum of parent node = sum of chidren".
I don't understand what is the gain to use the event handlers, if finally the test is marked as failed?

Jim






Re: Loop and event handler [message #1744764 is a reply to message #1744697] Fri, 30 September 2016 06:02 Go to previous messageGo to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
hi Jim,

as i understood:
the gain is, that you can handle unexpected situation and can continue the rest of the test.
e.g. a modal error dialog: in that case you want to see that there was an error and in additional you are able to execute the rest of the test and no information will be lost.
without the event handler the test will stop at the modal dialog and no other steps will be executed. in that case you lose much information about the rest you tested till the issue is fixed...


to your initial problem:
what i do in that cases is to store an index and check if there is no child with that index. in the check failed event handler i do my stuff (in your case store the price in addition to actual stored price) and increment the index.
reentry type is retry and the amount of retries is the maximum of children you expect.

Best Regard
Dominik
Re: Loop and event handler [message #1744767 is a reply to message #1744764] Fri, 30 September 2016 06:53 Go to previous messageGo to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
I have 100 branches to test in my tree and more in the future.
It means that I will get 100 errors, and I have to check the 100 errors in the report to see if it is really the event handler error (which is not a real error)?
It is not really serious. I think I should be great to improve the tool to prevent this.
Re: Loop and event handler [message #1744768 is a reply to message #1744767] Fri, 30 September 2016 06:52 Go to previous messageGo to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
nope you wont have to do this if you use the version with the retry event handler. with the event handler it will show as passed as long as the last check was ok

[Updated on: Fri, 30 September 2016 06:53]

Report message to a moderator

Re: Loop and event handler [message #1744793 is a reply to message #1744768] Fri, 30 September 2016 09:16 Go to previous messageGo to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
I did what you explained, but it does not decrease my indexChild variable.

In my Select Node by index path I have set the indexChild variable

INDEXPATH : ${indexChild}

Weird?

Re: Loop and event handler [message #1744812 is a reply to message #1744793] Fri, 30 September 2016 12:21 Go to previous messageGo to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
Finally I found this bug report

https://bugs.eclipse.org/bugs/show_bug.cgi?id=404446

But Now more complicated I would like to be able to manage a kind of recursive stuff.

To do a test case for all levels for one node in my tree.
If someone has a sample, it would be fine, because even with the event handler I am a bit blocked in my mind...

Re: Loop and event handler [message #1744930 is a reply to message #1744812] Mon, 03 October 2016 05:57 Go to previous message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
i had a similar problem and have no solution for that yet. but i think that this thing with build a sum of all children should be tested in unit test and in the ui test it should be at maximum one little smoke test to see if the values are shown the correct way

i don't have a problem with a variables in event handler. you can store the initial value of the variable in the case itself and in the event handler you in-/de-crement the variable

[Updated on: Mon, 03 October 2016 05:59]

Report message to a moderator

Previous Topic:Migration to new "execute external command" step
Next Topic:VARIABLE IN VARIABLE NAME
Goto Forum:
  


Current Time: Sun Sep 23 19:55:42 GMT 2018

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

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

Back to the top