# Login test script

**URL:** <https://community.gatling.io/t/login-test-script/5854>\
**Category:** Gatling (Open-Source)\
**Created:** [October 20, 2020, 7:07am UTC](https://community.gatling.io/t/login-test-script/5854 "2020-10-20T07:07:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Palman\_Ghalley](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@Palman\_Ghalley](https://community.gatling.io/u/Palman_Ghalley)\
**Post date:** [October 20, 2020, 7:07am UTC](https://community.gatling.io/t/login-test-script/5854/1 "2020-10-20T07:07:29Z")

</div>

package com.gatlingTest

import scala.concurrent.duration.\_

import io.gatling.core.Predef.\_  
import io.gatling.http.Predef.\_  
import io.gatling.jdbc.Predef.\_

class eShop1 extends Simulation {

val httpProtocol = http  
.baseUrl(“[https://pq2.selise.dev](https://pq2.selise.dev)”)  
.inferHtmlResources(BlackList("""._.js""", “”"._.css""", “”"._.gif""", “”"._.jpeg""", “”"._.jpg""", “”"._.ico""", “”"._.woff""", “”"._.woff2""", “”"._.(t|o)tf""", “”"._.png""", “”"._[detectportal.firefox.com](http://detectportal.firefox.com)._"""), WhiteList())  
.acceptHeader(“application/json, text/plain, _/_”)  
.acceptEncodingHeader(“gzip, deflate”)  
.acceptLanguageHeader(“en”)  
.userAgentHeader(“Mozilla/5.0 (X11; Ubuntu; Linux x86\_64; rv:81.0) Gecko/20100101 Firefox/81.0”)

val headers\_0 = Map(“Accept-Language” → “en-US,en;q=0.5”)

val headers\_1 = Map(  
“Accept” → “_/_”,  
“Accept-Language” → “en-US,en;q=0.5”)

val headers\_3 = Map(  
“Content-Type” → “application/json”,  
“Origin” → “here is url”,  
“authorization” → “”)  
val headers\_5 = Map(“authorization” → “Bearer tokenhere”)

val scn = scenario(“eShop1”)  
.exec(http(“Load Url”)  
.get("/api/v1/tenant/landings/current")  
.headers(headers\_0)  
.resources(http(“request\_1”)  
.get("/ngsw.json?ngsw-cache-bust=0.7976980452661159")  
.headers(headers\_1)))  
.pause(5)  
.exec(http(“request\_2”)  
.get("/ngsw.json?ngsw-cache-bust=0.7600048971185559")  
.headers(headers\_1))  
.pause(20)  
.exec(http(“signIn\_Page”)  
.post("/api/v1/auth/users/sign\_in")  
.headers(headers\_3)  
.body(RawFileBody(“com/gatlingTest/eshop1/0003\_request.json”))  
.resources(http(“request\_4”)  
.get("/ngsw.json?ngsw-cache-bust=0.28660300964688634")  
.headers(headers\_1),  
http(“getUsers”)  
.get("/api/v1/auth/users/current")  
.headers(headers\_5),  
http(“request\_6”)  
.get("/api/v1/auth/roles/1")  
.headers(headers\_5),  
http(“request\_7”)  
.get("/api/v1/auth/users/1")  
.headers(headers\_5),  
http(“request\_8”)  
.get("/api/v1/tenant/users/1/subscriptions?uuid=1593428414f650a4d7-63b2-4291-8de7-2a813924d32b")  
.headers(headers\_5)))

setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)  
}

I have above script so how can I login multiple user with that script. I tried using feeder but i am stock in where to input the credential. As it contain rawFileBody. please help.  
Thank you.

![](https://selise.ch/wp-content/uploads/2016/12/email.png)

Secure Link Services Group  
Zürich: Innovation Center, Haldenstrasse 23, 8306 Brüttisellen, Switzerland  
Dubai: Building 3, 3rd Floor, Dubai Design District, Dubai, United Arab Emirates  
Dhaka: Midas Center, Road 16 (new), Dhanmondi, Dhaka 1209, Bangladesh  
Thimphu: Bhutan Innovation Tech Center, Babesa, P.O. Box 633, Thimphu, Bhutan  
Contact us: CH +41 (0)448058044 | US +1 213 260 1291 | [www.selise.ch](http://www.selise.ch/)

_Important Note:_ _This e-mail and any attachment are confidential and may contain trade secrets and may well also be legally privileged or otherwise protected from disclosure. If you have received it in error, you are on notice of its status. Please notify us immediately by reply e-mail and then delete this e-mail and any attachment from your system. If you are not the intended recipient please understand that you must not copy this e-mail or any attachment or disclose the contents to any other person. Thank you for your cooperation._

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [October 21, 2020, 8:03am UTC](https://community.gatling.io/t/login-test-script/5854/2 "2020-10-21T08:03:31Z")

</div>

- Tutorials: [https://gatling.io/docs/current/quickstart/](https://gatling.io/docs/current/quickstart/) and [https://gatling.io/docs/current/advanced\_tutorial/](https://gatling.io/docs/current/advanced_tutorial/)
- Doc: [https://gatling.io/docs/current/http/http\_request/](https://gatling.io/docs/current/http/http_request/)
- Gatling Academy: [https://academy.gatling.io/](https://academy.gatling.io/)
