Forum Discussion

INQ_Mobile_Supp's avatar
INQ_Mobile_Supp
New Contributor
13 years ago

[Open] Accessing request log from Groovy in a LoadTest

Hi,

I'd like to be able to log (using a Groovy script) any http-related errors/exceptions during a load test.

During load tests, I frequently see SocketTimeoutExceptions, UnknownHostExceptions and NoHttpResponseExceptions, which I never see when sending single requests (this is not surprising). These exceptions are recorded in the LoadTest Log which can then be exported. However, I have a separate logging mechanism that records the data I am interested in, which uses a Groovy script. It would be nice if I could record everything a want using just the script, and not have to manually export the error logs.

I believe that from a Groovy script, you can access the 'soapUI log', 'http log', 'jetty log', 'error log', but not the 'request log' (at least I have not been able to access it). I can get exception details from the error log via a Groovy script, but this seems like an awful hack. I have to clear the log before each request, then read the top line before the next request is sent and clears the log. With the frequency of requests during a load test, most of the time I just capture random pieces of a stack trace, and not the first line of the error, which is what I am interested in.

So, is there a way of directly accessing http errors/exceptions in the request log from a running load test, or indeed some other succinct method. Note, i assumed messageExchange.getMessages() would tell me this, but it always returns null for me.

Many thanks.

1 Reply

  • Hi,

    I apologize for the slow response. We've been swamped these last couple of weeks, but we've seen your issue and while I cannot come up with a solution off the top of my head we'll get back to you as soon as possible. Sorry for keeping you waiting this long.

    Regards,

    Arian
    SmartBear Sweden