Gatling test failing for some of the sample, but not all

Hi All, I am executing following scenario. When I execute this with Gatling, it fails for some of the iterations. Basically, if I am doing 50 users over 20 seconds, it will pass for first 20 and then fail for next 30. and this failure and pass number changes with each run. It’s not fixed. Also, I am doing this so that I can have some concurrent users over execution time. Now if I have another run with enough of ramp up time, test will pass. For example, ramping up 20 users over 60 seconds.

But if i try to have a run of 50 users during 15 seconds in Jmeter, I don’t see any issues. So I am not sure what am i doing wrong. Not sure if it’s the issue with the way variable is being saved or if it has anything to do with Gatling’s limitations.

Because the first script fails, second one doesn’t even get executed for the failed samples. I get following error for the failed samples:


regex((?<=)(.*\n?)(?=)).find.exis 38 (100.0%)

ts, found nothing


package computerdatabase

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class UHONETest extends Simulation {

val httpProtocol = http.baseUrl("url1")

val header = Map(
"Authorization" -> "Basic annnbnb267267637")

val pl1 = scenario("claimsummary").exec(http("myclaims")
.body(ElFileBody("ehub.txt")).check( regex( "(?<=<SubscriberID>)(.*\\n?)(?=</SubscriberID>)").saveAs("subid")))
setUp(pl1.inject(rampUsers(50) during (15 seconds)).protocols(httpProtocol))

Enable DEBUG logging in logback.xml so you can see the offending payloads.
You’ll then be able to figure out why your checks fail.

Hi Stephane,
I did and that would basically provide me the response only . for failed test cases which I was already getting as I was using trace before. it’s the same test which is getting executed 50 times or 100 times. And it fails depending on how much time I am trying to execute it for. If the rampup time is less, it start failing after passing some of the samples, but if rampup time is more than the samples number, it passes for all the samples. So does it has anything to do with how Gatling is handling number of users (threads etc.). I am basically trying to achieve a particular number of concurrency in my test like 40 concurrent users in 15 minutes so that i can figure out how the response time looks like when 40 users will be hitting the same service at the same time. If you can suggest an alternative to do that, would be much appreciated.



  1. your system under load can’t handle the load your currently generating with Gatling (which is 50 users processing your scenario, started uniformly over 20 seconds, ie 2.5 users/s). Don’t blame the messenger. Either your injection profile is not realistic, or your application doesn’t meet the requirements.
  2. you don’t really understand how injection profiles work. “Concurrent users” means closed workload model and there’s a very good change that’s not how your application works. Here are several reads that would help: