Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Iteration of items(Jubula could be more powerful with support for iterations of tests)
Iteration of items [message #1402952] Fri, 18 July 2014 15:37 Go to next message
Simon Keen is currently offline Simon KeenFriend
Messages: 1
Registered: July 2014
Junior Member
Currently there does not appear to be a simple way to iterate test steps based on information displayed in an AUT.

For example, there is no simple way to check all the values in a particular column of a table row by row without quite complicated use of formulae and central data sets to constrain the maximum row number.

I would now like to be able to repeat a test for each item available in a combo box on a particular window within our AUT. This would involve creating steps to select the first item in the combo, wait for the GUI to react, and then executing a series of steps. Once this is complete, repeat for the next item in the combo until all items in the combo have been iterated through.

Are there any plans to incorporate a "for" loop type step?

I think without this functionality the usefulness of the tool is limited for enterprise usage.
Re: Iteration of items [message #1402967 is a reply to message #1402952] Fri, 18 July 2014 20:39 Go to previous message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
You can use ub_grc_storeProperty to store the "itemCount" property of the Combo component in a variable (e.g. "COUNT"), use another variable (e.g. "INDEX") as a loop counter starting at 1, and use $INDEX in an event handler that calls ub_cbc_selectEntryByIndex and does whatever else you want.

I think I have made a post explaining how to implement loop logic before, but I couldn't find it easily with a forum search, so here it is:
1. Use a Test Step to check (numeric values) for $INDEX > $COUNT.
2. In the same Test Case where you execute that step, add a "Check Failed" event handler with reentry type RETRY and max retries set to a number higher than the largest number of Combo items you ever expect to have.
3. In that event handler, execute whatever steps you want to (in this case, starting with ub_cbc_selectEntryByIndex as mentioned above).
4. At the end of the event handler, store the value "?trunc(?add($INDEX,1),0)" (without quotes) in the variable INDEX.

This should execute your event handler once for each value in the Combo, and then pass on the last retry.
Previous Topic:Externalisation of string for Jubula
Next Topic:HTML AUT and Swing AUT
Goto Forum:
  


Current Time: Tue Apr 21 21:12:19 GMT 2015

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

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