How To Get Scenario Name On Failed Request During Parallel Run

243 views
Skip to first unread message

Christian Crews

unread,
Jun 30, 2015, 5:19:04 PM6/30/15
to gat...@googlegroups.com
Hi,

I've got a suite of scenarios that I'm running in parallel. They make use of various shared requests. The problem is that when a request fails, I am unsure of a good way to determine which scenario owns that failing request. Is there a way that I can output the scenario name with the failed check errors?

Thanks,
Christian
Message has been deleted

Christian Crews

unread,
Jul 1, 2015, 10:55:03 AM7/1/15
to gat...@googlegroups.com
So I see that you can get at the scenario name with the following. How do I go about adding that to the official failure message output?
      .exec(invalidCode.httpRequest
        .extraInfoExtractor { response =>
          if (response.status != 200) {
            val scnName = response.session.scenarioName
            
            // how to output it with errors?
          }
          Nil
      })

Can I access the errors from the scala class? I want to see the scenario name next to the request failure within the output below...

---- Errors --------------------------------------------------------------------

status.find.in(200,304,201,202,203,204,205,206,207,208,209), b      1 (100.0%)

ut actually found 422

================================================================================

Stéphane LANDELLE

unread,
Jul 2, 2015, 3:48:20 AM7/2/15
to gat...@googlegroups.com
You have to wrap the HttpCheck into a custom one and override the check method so you can change the Failure message with mapError.

Stéphane Landelle
Lead developer


On Wed, Jul 1, 2015 at 4:52 PM, Christian Crews <ccr...@grubhub.com> wrote:
So I see that you can get at the scenario name with the following. How do I go about adding that to the official failure message output?
      .exec(invalidCode.httpRequest
        .extraInfoExtractor { response =>
          if (response.status != 200) {
            val scnName = response.session.scenarioName
            
            // how to output it with errors?
          }
          Nil
      })

Can I access the errors from the scala class? I want to see the error message within the output below...

---- Errors --------------------------------------------------------------------

> status.find.in(200,304,201,202,203,204,205,206,207,208,209), b      1 (100.0%)

ut actually found 422

================================================================================

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Crews

unread,
Jul 7, 2015, 3:47:29 PM7/7/15
to gat...@googlegroups.com
Thanks!

Gregory Jansen

unread,
Jan 5, 2016, 12:14:27 PM1/5/16
to Gatling User Group
Hello Stéphane,
I am trying to log some session data with my HTTP failure messages, such as timeouts. Would this be the appropriate strategy? Also if there are any code example that would be terrific. Still learning to think in Scala.
many thanks,
Greg


On Thursday, July 2, 2015 at 3:48:20 AM UTC-4, Stéphane Landelle wrote:
Reply all
Reply to author
Forward
0 new messages