Forum Discussion

redbank199's avatar
redbank199
New Contributor
9 years ago

Groovy script: red atar

At the end of a Groovy test step script, I have the following line

 

context.status = Status.FAILED

 

When the test case with this test step is run in SoapUI GUI, it did not show this Groovy test step as a "Red Star".

 

Is it possible to show a failed Groovy script as a Red Star in SoapUI GUI ? Thanks.

 

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    I believe that you might intended to do that based on some condition, correct?

     

    Then you can do the following:

    if (condition) {
       log.error "Test failed due ..."
       throw new Error("Error message")
    } else { log.info "Test passed" }

     

  • KarelHusa's avatar
    KarelHusa
    Champion Level 3

    redbank199, yes, if you put an assertion into your Groovy script and the assertion fails, the star icon gets red.

     

    Just make a Groovy Script test step with the following code and execute it:

     

    assert false

    Karel