excilys/gatling — Issue #385: StringIndexOutOfBoundsException is scenario name is wrong
Author: pyricau
Created: 2012-01-30 10:36:38+00:00
State: open

I created a scenario file in users-files/simulation, without respecting the expect format for the name.

I named the file : **test_bug.txt**

When I launch gatling (1.0.3 bundle), it shows the following :

```

~/Downloads/gatling-charts-highcharts-1.0.3/bin/gatling.sh 130 ↵
GATLING_HOME not set, using default location (/Users/pyricau/Downloads/gatling-charts-highcharts-1.0.3)
-----------
Gatling cli
-----------

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$displayMenuAndRun$1.apply(Gatling.scala:104)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$displayMenuAndRun$1.apply(Gatling.scala:103)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.Iterator$Partner$1.foreach(Iterator.scala:939)
at com.excilys.ebi.gatling.app.Gatling$.displayMenuAndRun(Gatling.scala:103)
at com.excilys.ebi.gatling.app.Gatling$.runGatling(Gatling.scala:81)
at com.excilys.ebi.gatling.app.Gatling$.main(Gatling.scala:63)
at com.excilys.ebi.gatling.app.Gatling.main(Gatling.scala)
```

Renaming the file to **basic-script-example@default.txt** makes things work.

If you expect a standard name for files, there should be a warning :) .