How to debug in Intellij Idea using sbt project

Hi,

Frustrated by the lack of answers to this issue, I resolved it myself using similar ideas from other builds.
I started using the following github project: https://github.com/bbc/example-gatling-sbt

In the build.sbt for this project I added the following line:

javaOptions in Gatling ++= Seq("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=XXXX")

where XXXX is your port for a remote debug instance from Intellij to connect to.

Note that I start the server in suspend mode as you cannot catch it before it invokes the simulation as a future.

In an intellij terminal or an external console, launch your test using the sbt invocation:

sbt clean gatling:testOnly myClass…

In Intellij, launch a remote run configuration with port pointing to XXXX above.

Set your breakpoints appropriately in your Simulation class and you can debug your test:

Happy Debugging!
Henry

As explained in the doc, Gating DSL components are builders that are built once before the run starts.
They are not the real thing that gets executed, and then our engine is fully asynchronous, so not sure a debugger would really help.

Salut Stephane,

Understood, however, any possibility of controlling the execution flow, even at the pre-run stage, is better than none.

Henry

Salut,

We have some plans for that, but it will be part of our FrontLine suite, hence not open source.

You can also lower logging level.