Some parts of code are skipped when running simulation via terminal

Hello guys

Despite on my very little knowledge of Scala and Gatling I manage to produce code that does work when run via Engine class, but when I run it in terminal some parts of the code are not executed.

A bit of context to that:

  • Maven project
  • Scala v2.13
  • Gatling with Scala v3.8.3
  • Scala Maven Plugin 4.7.1
  • Gatling Maven Plugin 4.2.6
  • Java 11
  • and I also use Slick library (v3.4.0) for DB queries

What I’m trying to do:

  1. Send Soap message via POST method. Message is created with help of a custom feeder
  2. Fetch value from DB by using id of the sent message, which was generated by feeder
  3. Set the obtained value into session
  4. Use set session value for a GET request

The DB value I get by using Slick models and some advanced JOINs.

When I run Scenario in IDE it works perfectly. But this is not the case when I run it via terminal: mvn gatling:test
For integration of Gatling scripts into CI/CD pipeline I need to make it work with Maven. :slight_smile:

Step 2 is not executed, it doesn’t fetch anything. Thus the GET check in step 4 is failed, since an empty value was set in Step 3.

Does anybody know what could be the problem here?

Any help would very much appreciated.

When I run Scenario in IDE it works perfectly. But this is not the case when I run it via terminal: mvn gatling:test

Honestly, this doesn’t make much sense, unless you’re not executing the same code. Make sure your code is properly saved on the file system and do a mvn clean.