Read target/js folder

Hi ,
I want to read the global_stats.json file that is under the targer/…/js folder. (This folder will be generated when the tests are finished running) . I was using the after hook but there are some issues with it.
The js folder will not be generated until gatling finishes running the tests. and the after hook is part of the test. In other words you cannot read from a folder while it has not been created yet.
Is there any way to hook something to framework after gatling is done testing and generating report? Or any idea how I can resolve this? I appreciate your reply.

Many Thanks,
Neda

You will need to write something which runs the test, generates results and then extracts whatever information you need from the generated files once the test is complete (e.g. shell script?).

Thanks. I’ll try it.

Hi ,

I am working on the shell script and everything looks good so far, except one issue. In my shell, I am running the tests trough sbt and then running the classes that extracts the json response. Something like

sbt gatling:test

scala -cp

The issue is that as soon as sbt gatling:test is done it would not go to the next line in the shell script. Is there anyway that the command can be modified that would not quit the process ?

Thanks,

Actually, I found an easier way to make it work without writing the shell script. I created scala class with main method that was doing the extract of the json file and then run the sbt gatling:test || sbt run .

Thanks ,
Neda