scalashellgatling

Scala Execute Shell file


I have a .sh file in which I want to run in Scala once a Gatling scenario has finished.

Does anyone have any code that would execute my sh script.


Solution

  • You should use the after block provided by Gattling :-

    Refer this : https://docs.gatling.io/reference/script/core/simulation/#hooks

    Here you can use after block :-

    after {  println("Simulation is finished!")}
    

    Rest all is pure scala so use @Andrey answer above