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”)
.inferHtmlResources(BlackList("""..js""", “”"..css""", “”"..gif""", “”"..jpeg""", “”"..jpg""", “”"..ico""", “”"..woff""", “”"..woff2""", “”"..(t|o)tf""", “”"..png""", “”".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.
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
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.