I created my first Gatling file called RecordedSimulation.scala", the script logs into my application and logs out.
So I wanted to see what a failure looked like, so I modified the username in the script to be invalid username, but when I run the file, my results appear to have all passed. I don’t get it
Me neither.
Was your updated script properly saved?
I am not sure I understand what you mean properly saved? below is a snipped of the code I changed. All I did was remove the “a” in “zsousa”. Then I saved the file.
.exec(http(“request_3”)
.post("/system/login.php")
.headers(headers_3)
.param(“username”, “zsous”)
.param(“password”, “1”)
.param(“ajaxLogin”, “1”)
Hi,
The default check, which you are using since you didn’t specify one, checks the HTTP response status code is in the range 200-210.
If your application does not answer to a failed login with a specific status code(401 for example, as it’s the best suited for a failed login attempt), it isn’t considered as a failure.
If it’s the case, you’ll have to check manually that is the login attempt failed : if the page you’re redirected to after the failed login attempt contains “Invalid login/password” for example, you can use a regex check to check if it’s present or not. You can find more information in the Checks documentation : https://github.com/excilys/gatling/wiki/Checks
Cheers,
Pierre
Ah, good catch, Pierre!
thank you so much.