Forum Discussion

coexmatrix's avatar
coexmatrix
Occasional Contributor
15 years ago

testStep status issue

Hello,
I have test cases with multiple test steps. The last test step in all of these test case is a groovy script.

I am attempting to obtain the string value (OK, Fail etc...) for the status of a specific testStep contained within the testCase. I have used the following:
def status = String.valueOf( testRunner.results.status )

but of course that returns the status of all test steps within the test case

So ive made many modifications and have been using several different variations of this:
def status = String.valueOf( testRunner.testCase.testSteps["TESTSTEPNAME"].testRequest.response.status )

but I always receive either an error or the results of all the steps.

Please Help.

Thank You.

4 Replies

  • coexmatrix's avatar
    coexmatrix
    Occasional Contributor
    Head beating against the wall


    AHHHHh help!!!

    Any help greatly appreciated. Losing my mind.
  • coexmatrix's avatar
    coexmatrix
    Occasional Contributor
    Anyone have any help at all?

    Ive tried so many different variations and classes, there has to be something simple I am missing here.
  • This might help:


    testRunner.getResults().each {
    log.info 'testStep Name: ' + it.getTestStep().getLabel() + ', Status: ' + it.getStatus()

    if (it.getStatus().toString() == "FAILED") {
    log.error 'Hey, this test step FAILED: ' + it.getTestStep().getLabel()
    }
    }