Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Unable to Pass Updated Variable from Event Handler(Variables no longer being passed from Event Handler to top level Test Case)
Unable to Pass Updated Variable from Event Handler [message #1408444] Fri, 15 August 2014 04:08 Go to next message
Byron Kooima is currently offline Byron KooimaFriend
Messages: 5
Registered: July 2013
Junior Member
So over the past six months, I have developed a number of psuedo loops in Jubula and they have worked perfectly in Jubula 1.3. We have recently updated to Jubula 8.0 and all of my loops are now broken. Here is the scenario that creates an If/Then loop to parse a table object.

Top Level Test Case:
1. ub_grc_storeProperty ($Row_Count) - Stores the "itemCount" of the table to determine total number of rows.
2. ub_app_storeValue ($Row_Index) - Stores an initial value of 0 for the Row Index
3. ub_tbl_selectValueFromRow - Select the first row of the table
4. ub_app_checkNumericValues - Checks to see if $Row_Count = ?trunc(?add($Row_Index,1),0)

On "Check Failed" we call the following Event Handler:
1. ub_app_storeValue ($Row_Index) - Stores the ?trunc(?add($Row_Index,1),0) back to Row_Index (Increments the loop)
2. ub_tbl_checkExistenceOfValueInRow - Checks the table value at Row = $Row_Index
3. ub_tbl_move - Move down one row in the table

This loop structure used to work wonderfully to parse through a table with any number of rows. Now, for some reason the $Row_Index that is incremented in the Event Handler is not passed back up to the main TC when it does a "Retry" on check of the numeric values.

When I interrogate the Test Results, step 4 of the Test case gets repeated as I would expect, but the value of $Row_Index stays "0". So every time it executes step 4 from the TC, $Row_Count never equals $Row_Index (i.e. 16 = 1 is what I see for every ub_app_checkNumericValues). Eventually my loop fails because the Event Handler attempts to step to a Row that doesn't exist in the table.

The interesting thing is that inside the Event Handler, $Row_Index is incrementing correctly. So for some reason the $Row_Index variable in my Event Handler is not being treated the same as the $Row_Index in my top level TC.

This loop logic took some serious time to figure out and I would rather not throw it out. Especially since it worked perfectly fine in previous versions of Jubula.

Any help would be appreciated. Thanks, Byron.
Re: Unable to Pass Updated Variable from Event Handler [message #1408533 is a reply to message #1408444] Fri, 15 August 2014 09:50 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1320
Registered: July 2009
Senior Member
Hi,

Thanks for the information. For version 7.0, we fixed an error in the resolving of parameters [1] which lead to this change. It was documented in the release notes for 7.0 [2] and there is a ticket that describes how to adapt tests to the new behaviour [3].

I know there have been forum entries to this as well, but I'm unable to find them at the moment.

Best regards,
Alex


[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=382169
[2] http://testing.bredex.de/sw-doku-downloads.html?file=files/content_closed/software/documentation/releaseNotes.pdf
[3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=404446
Re: Unable to Pass Updated Variable from Event Handler [message #1408586 is a reply to message #1408533] Fri, 15 August 2014 13:31 Go to previous messageGo to next message
Byron Kooima is currently offline Byron KooimaFriend
Messages: 5
Registered: July 2013
Junior Member
Thanks Alex for the fast response.

Your solution worked perfectly! I replaced the predefined modules with Test Steps and all is good. Now that I understand how the calling of variables works, I can come up with some more complex Test Cases.

I also searched through the forum before I posted and couldn't find any threads on this issue. Hopefully this one will stick around for a while and will help others.

Thanks, Byron.
Re: Unable to Pass Updated Variable from Event Handler [message #1408596 is a reply to message #1408586] Fri, 15 August 2014 14:12 Go to previous message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1320
Registered: July 2009
Senior Member
Thanks for your feedback! I'm glad it works for you now Smile
Previous Topic:Errors which appears with the automated tests
Next Topic:Object Mapping
Goto Forum:
  


Current Time: Sun Apr 26 17:27:11 GMT 2015

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

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