Gatling Error: There is no simulation script. Please check that your scripts are in user-files/simulations
Asked Answered
S

6

10

I'm new to Gatling and I'm trying to use ./gatling.sh to open a simulation script but I'm getting the following error:

There is no simulation script. Please check that your scripts are in user-files/simulations

I can view multiple scripts within the user-files/simulations directory but still get the error.

Does anyone have any ideas why Gatling is not finding the simulation script?

Stillas answered 15/2, 2018 at 12:33 Comment(5)
Have you checked if your scripts extend the Simulation class? Like so class MyScript extends Simulation Otherwise they won't be found by Gatling.Muscarine
yes, the scripts all extend the simulation class.Stillas
I am facing the same error on Mac. Did you manage to resolve it?Futurism
I'm facing the same problem in Windows, when trying to run the basic gatling simulation. Gatling version 2.3.1Arturoartus
Gatling 3.0.3, Linux Alpine, 1.8 OpenJDK here. JAVA_HOME is set correctly. Stumped.Tiphani
A
5

TLDR The error doesn't necessarily mean that there are no scripts, but that the gatling was not able to find compiled script.

In details

I was facing a similar error, but it was something like this:

Could not reserve enough space for 1048576KB object heap
There is no simulation script. Please check that your scripts are in user-files/simulations

So I opened the gatling.bat file and changed the parameter of set JAVA_OPTS from -Xmx1G to be -Xmx512M:

set JAVA_OPTS=-server -Xmx512M...

After I did that, the gatling was able to really start running, compiling the files and display:

Choose a simulation number:
 [0] computerdatabase.BasicSimulation
 [1] computerdatabase.advanced.AdvancedSimulationStep01
 [2] computerdatabase.advanced.AdvancedSimulationStep02
 [3] computerdatabase.advanced.AdvancedSimulationStep03
 [4] computerdatabase.advanced.AdvancedSimulationStep04
 [5] computerdatabase.advanced.AdvancedSimulationStep05
Arturoartus answered 4/4, 2018 at 7:22 Comment(0)
C
5

Gatling can only run with Jdk8. For windows, you can install multiple JDK as well. After install JDK8, go to your bin/gatling.bat, right click on that and select Edit.

Replace all %JAVA_HOME% with the your JDK8 path.

Example

%JAVA_HOME%\bin\java.exe

to

C:\Program Files\Java\jdk1.8.0_181\bin\java.exe

Calderon answered 14/8, 2018 at 0:15 Comment(0)
P
3

Make sure that you have the JAVA_HOME environment variable set.

On a Mac, you can type "env" in Terminal to show all of your environment variables. On Windows, type "set" in cmd to get a list.

You should see something like:

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

Posse answered 23/4, 2018 at 15:27 Comment(0)
S
2

You should first check your scala code and remove all the errors from your file/all the files, even if any one of the file has some issues then none of the test is going to get compiled and run.

  1. Please check the package names and the file actually belongs to same package or not. [this was the issue in my case.]
  2. Check indentation, it should not mismatch. [this was also there in my case]
  3. Then you can check replacing JAVA_HOME in gatling.bat or gatling.sh file with the actual path as mentioned by some guys here.
  4. Lastly you can change the JAVA_OPTS like mentioned by some one in above comments.[from -Xmx1G to be -Xmx512M]
Silvereye answered 21/11, 2019 at 14:44 Comment(0)
S
0

This error may be caused by JAVA_HOME wrongly set.

Following Gatling documentation the system needs JDK8 to run:

https://gatling.io/docs/2.3/quickstart

Does not support JDK9 at the moment.

To check if you have JDK8 installed on Mac for example you can do:

# List Java versions installed
/usr/libexec/java_home -V

if you get:

Matching Java Virtual Machines (1):
9.0.4, x86_64:  "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home

Means that there is only JDK9 installed. Then you have to download and instal JDK8 (in Mac you can have several JDK installed), now the previous command returns:

Matching Java Virtual Machines (2):
    9.0.4, x86_64:  "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
    1.8.0_171, x86_64:  "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

and we can set JAVA_HOME with JDK8:

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

After these steps running gatling.sh should not show the error anymore.

Subplot answered 12/6, 2018 at 13:22 Comment(0)
W
0

Add the next code to logback.xml

<root level="WARN">
    <appender-ref ref="CONSOLE" />
</root>

And start gatling.sh

P.S. it's magical

Wallflower answered 28/8, 2019 at 18:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.