# Need help understanding Gatling test file

**URL:** <https://community.gatling.io/t/need-help-understanding-gatling-test-file/371>\
**Category:** Gatling (Open-Source)\
**Created:** [May 9, 2013, 7:41pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371 "2013-05-09T19:41:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [May 9, 2013, 7:41pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371/1 "2013-05-09T19:41:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [May 9, 2013, 10:01pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371/2 "2013-05-09T22:01:27Z")

</div>

Me neither.  
Was your updated script properly saved?

---

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [May 10, 2013, 12:53pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371/3 "2013-05-10T12:53:53Z")

</div>

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”)

---

<div class="post-metadata">

**Author:** ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)\
**Post date:** [May 10, 2013, 2:43pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371/4 "2013-05-10T14:43:13Z")

</div>

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](https://github.com/excilys/gatling/wiki/Checks)

Cheers,

Pierre

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [May 10, 2013, 7:25pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371/5 "2013-05-10T19:25:05Z")

</div>

Ah, good catch, Pierre!

---

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [May 13, 2013, 12:28pm UTC](https://community.gatling.io/t/need-help-understanding-gatling-test-file/371/6 "2013-05-13T12:28:13Z")

</div>

thank you so much.
