Forum Discussion

JMcKinley's avatar
JMcKinley
Contributor
16 years ago

Question: Passing properties to a followup test case

Based on some of your previous replies (thank you!), I am able to grab data I want and I then store it in a property that is in a property step.

Now, I want to pass that data (through the property) to a different test case. I looked in the documentation and if the info I needed was there, I missed it. 

At any rate, how do I pass a property from one test case to another?

Thanks for all your help!

6 Replies

  • I did have one follow up question:

    I haven't tried to implement your suggestion yet, but one of the things I want the system to do is show a failure for each test case... so, for example, if I create a "parent" test case that contains two "child" test cases so that I can pass data from one test case to another, and the first test case succeeds but the second test case fails, will the system show that the second test case fails? One of the reason I want to break up my test cases and pass data from one into another is so that we can see which parts of the system might fail.

    For example (totally made up), lets say that test case 1 creates a record and succeeds but now I want to update the record so I want to pass the key from the create to an update test case. In a run of the suite (automated/unattended), the create works but the update fails. In this example, I would want to see that it was the update not the create that failed.

    If I create the test case using the documentation you provided (thanks, btw!), is there a way to make sure that the system shows that it was the update test case that failed? My concern is that we would only see/get a message that it was the parent test case that failed... is there a way to make sure the system shows that the child test cases fail - not just the parent. Maybe it already does that by default OR if not, is there a way to do this?

    Thanks again!!
    Jim
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Jim,

    the "Run TestCase" step will fail if the called testcase failes, so in your report you should see which of the called testcases that succeeds/fails. I'm not exactly sure though how detailed information you will get about the failure, try and see!

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Thanks for the help!

    I finally got it to work (had to "play with it")... my time was divided and I had a few issues getting it to work (for some reason, the system would not allow me to add a property to a test case the first few times I tried - I discovered if I "rebooted"  SOAP when this happened that it would then allow me to... have no idea what that issue was)...

    Thanks again!
    Jim
  • Well, I was premature saying it completely worked... I was able to return properties to the calling test case (I will call this the parent test case)... but now, I want to pass that property to another test case that is also called by the parent test case.

    In the parent test case:

    1. I returned the value from the first child test case to the parent test case in a property step property.
    2. I created a "run test case" step for the new child test case.
    3. before this "run test case" step, I have a property transfer step. The source for this step is the property in the parent test case that I want to pass to the child test case. The target is a test case property in the child test case.

    In the child test case:

    1. I defined a test case property (the one that the parent test case tries to set)
    2. I have a property trasnfer step that is supposed to take whatever is in the test case property (from the previous step) and transfer it into a property step property.

    This is not working... if I run the parent test case, the data stored in the parent property step is not getting to the child test case property... which means it does not get transferred to the child test case property step...

    I hope this makes sense...

    What am I doing wrong?

    Thanks!
    Jim
  • Nevermind, I got it to work... What I did was "uncheck" the test case property so that it was not a return value... I did not realize that it was a problem to both pass and return a value from the same property 

    Thanks!
    Jim