Forum Discussion

abolourian's avatar
abolourian
Occasional Contributor
15 years ago

Get soapUI log using script

I get the following error when running a Test Request which is completely valid error which I expect.
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Therefore I'm not getting any specific response to check against in an assertion. Is there a way to get the soapUI log in Groovy script?

Thanks
  • Hello,

    This should be doable, but it's a bit tricky. First off, create an event handler in the Project:

    RequestFilter.afterRequest:

    def method = context.httpMethod

    if( method.failed ) {
    context.failureCause = method.failed ? method.failureCause.toString() : null
    }


    This will check if the request failed, and if so attach the failure cause to the response, which you will then be able to check in a groovy assertion:

    def failureCause = context.failureCause

    if( failureCause != null ) {
    log.info failureCause
    assert false
    } else {
    log.info "OK"
    }


    Good luck!

    Regards,
    Dain
    eviware.com