any help on this.
what im trying to do…
get - blah.com/blah.php
check - status 200
check content “blabla” - if its there KO the request
so i’ve got this in my scala file
.check(regex(“NO DONG BOOO.”).notExists)
so when a page is up and running properly it will display random information… but if it goes down it will have the same info displayed in example case -NO DONG BOOO - when i run the test i need this to fail if the no dong booo is in response/content.
why doesn’t this work?
No idea, should work.
all of the script if this helps of course…
nothing at all, as if the actual line of code is ignored?!
I did a quick test, it seems to work fine for me, sorry.
really odd, what version of gatling did you test it on?
Hello again! thanks for the help, got it working not sure why but i get the proper result now.
another question and probably not the last one either, is there a way to run a certain simulation from console with one line of code? something like
click enter and it runs mysimulation.scala?
Back again, dumbo me didn’t think of reading the docs found a way to run it.
another question that i seriously can’t find an answer to in the docs is this;
i want to run a simulation and at the end of it i want gatling to run an action/job kinda thing if it receives a KO after running a test.
for e.g. run test - get KO - email result to firstname.lastname@example.org
is this possible or are we going to need to write an extra script for that?
thanks for support btw.
There is no built-in that allows you to do that, sorry.
However, you can implement it yourself pretty easily :
- add some assertions (https://github.com/excilys/gatling/wiki/Assertions) to your simulation to specify your failure criteria.
- Wrap Gatling launch with a bash script (or anything you’d like) start Gatling, wait for your simulation to finish and get the exit code
- If the exit code was 0, everything went fine and your simulation suceeded according to your assertions. If the error code was 2, then one or multiple assertions failed, and you cand send your email to notify the simulation failure.
Thank you! sounds good, will give it a shot and see how it works.
By the way, you could achieve the same goal using Gatling’s Maven Plugin and Jenkins plugin.
You’d only need to setup some assertions and a bit of configuration on the Jenkins side.
If one or more assertions failed, the Maven build would fail which in turn would make the Jenkins build fail. You’d need to configure Jenkins to send an email if a build fails.
However, if you’re not already using Maven and Jenkins, a custom script would be much simpler of course.