Forum Discussion

Kathryn_O_Malle's avatar
Kathryn_O_Malle
Contributor
16 years ago

How to find out results of assertions checked in a child/slave testcase?

Hi,

I've set up a controlling testcase (TC:Master) that calls a slave testcase (TC:Slave). In TC:Slave the final step is a SOAP Test Request test that submits the XML message that has been generated. There is an assertion on this step to check that a "Receipt: Message Okay" response has been received.

Is there a way I can determine in TC:Master the results of the assertion checks in TC:Slave?

Is there also a way I can use the above results to help generate an overall pass / fail result for TC:Master?
[NB: There can be further assertion checks elsewhere in TC:Master and additional TC:Slave testcases...]

Many thanks...
Adam

3 Replies

  • Hi Adam,

    for now the Run TestCase TestStep will fail if the called TestCase fails, if you want more fine-grained access to the target TestCase results you will need to resort to a groovy script that can inspect the results of each teststep in the called testcase.

    Does that help / make sense?

    regards!

    /Ole
    eviware.com
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    How about adding a Groovy script statement after the request to set a TestCase property:

    def requestStep = assertionStatus = testRunner.testCase.getTestStepByName("Test Request")
    String assertionStatus = requestStep.getAssertionByName("My Assertion").status
    testRunner.testCase.setPropertyValue("assertionStatus", assertionStatus)


    which you can read after Run TestCase step?