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?

Menahem
  • 3,974
  • 1
  • 28
  • 43
Timothy Hawkins
  • 151
  • 1
  • 3
  • 9

6 Answers6

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
riorio
  • 6,500
  • 7
  • 47
  • 100
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

Gibolt
  • 42,564
  • 15
  • 187
  • 127
Chee Er Lim
  • 51
  • 1
  • 2
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

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]
Ghana
  • 63
  • 8
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.

Belen
  • 673
  • 2
  • 10
  • 25
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

Nick
  • 11
  • 2