Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Use a different Datasets on a nested case(Use a different Datasets on a nested case)
Use a different Datasets on a nested case [message #1383682] Mon, 26 May 2014 13:39 Go to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
Hi,

i have a problem. i want to use a case thats run n times (parametrized by dataset). this case is set into another case, in addition to some steps i need to execute once.

an example: U have a tree an would like to check the existence of childs and if the amount of childs are correct.

my Tree:

parent A
   child 1
   child 2
   child 3
Parent B
   child 1
   child 2
   child 3
   child 4
   child 5


So i made 2 cases:

Case 1:
#Select Parent x
#Init Variable CNT = 1
#Reference Case 2 (With Dataset containing childs)
#check theres no child with index of CNT

Case 2:
#check child y exists (parameter)
#increment CNT

I wanna use Case 1 on parent A AND parent B, but the problem is that they have a different ammount of childs, so i cant use parameters in the Dataset

Does anybody have an idea how to solve that, or see any different way to manage that?

[Updated on: Tue, 27 May 2014 13:24]

Report message to a moderator

Re: Use a different Datasets on a nested case [message #1383989 is a reply to message #1383682] Tue, 27 May 2014 17:14 Go to previous messageGo to next message
David Hickernell is currently offline David HickernellFriend
Messages: 85
Registered: October 2012
Member
So, are you saying that you need to use two different datasets, one for each parent? I am not sure that I fully understand the question.

EDIT:
If I am correct, I think that what you could do is combine both datasets into one, including a new column for the parent, and skip the case when the parent does not match. Does that sound like it would work?

[Updated on: Tue, 27 May 2014 17:31]

Report message to a moderator

Re: Use a different Datasets on a nested case [message #1384084 is a reply to message #1383989] Wed, 28 May 2014 05:25 Go to previous messageGo to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
i dont really know what u mean. can u give me an example maybe?
Re: Use a different Datasets on a nested case [message #1384263 is a reply to message #1384084] Wed, 28 May 2014 14:48 Go to previous messageGo to next message
David Hickernell is currently offline David HickernellFriend
Messages: 85
Registered: October 2012
Member
I am assuming that each of your datasets has one row corresponding to each child. If so, you could combine them like this:
PARENT     CHILD
Parent A   child 1
Parent A   child 2
Parent A   child 3
Parent B   child 1
Parent B   child 2
Parent B   child 3
Parent B   child 4
Parent B   child 5

Then, your current Case 2 would become Case 3, and the new Case 2 would be:
1. Store =PARENT in variable PAR
2. Check (Text of selected node) not equals $PAR
Event Handler (Check Failed, RETRY, 1 time): Case 3

And you would add to the end of Case 3:
Store '' in variable PAR

Does that make sense?
Re: Use a different Datasets on a nested case [message #1384990 is a reply to message #1384263] Tue, 03 June 2014 13:48 Go to previous messageGo to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
i can't see a difference in that way. i also dont understand why u use the variable PAR in here
Re: Use a different Datasets on a nested case [message #1385039 is a reply to message #1384990] Tue, 03 June 2014 21:24 Go to previous message
David Hickernell is currently offline David HickernellFriend
Messages: 85
Registered: October 2012
Member
The variable is just a part of implementing conditional logic in a test case. If you want Case 3 to be executed only when the text of the selected node matches PARENT, then the check in Case 2 will pass without executing Case 3 when the node text does not match, and execute Case 3 in the event handler (and then pass upon retry) when it does. PARENT needs to be stored in a variable so that its value can be changed to a non-matching value after Case 3 is executed, so that it will pass the check on the second try.
Previous Topic:Is there a way to disable logging?
Next Topic:Multiple error messages when switching projects
Goto Forum:
  


Current Time: Fri Mar 29 15:03:36 GMT 2024

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

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

Back to the top