I execute perf tests using below maven command,
mvn gatling:test -Dgatling.simulationClass=simulations.Stageabcsite
Now my need is i would like to use a Java Lambda function instead of mvn because i have a requirement to run this gatling code on AWS lambda
Here is my pom.xml
4.0.0
com.sre
SRE
3.3.1
Here is the gatling code which Java Lambda function should be calling
package simulations
import baseConfig.BaseSimulation
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class Stageabcsite extends BaseSimulation {
val headers_0 = Map(
“accept” → “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”,
“accept-encoding” → “gzip, deflate, br”,
“accept-language” → “en-US,en;q=0.9”,
“cache-control” → “max-age=0”,
“content-type” → “multipart/form-data; boundary=----WebKitFormBoundarygecOpCycXAuBFkiL”,
“origin” → “https://admin-stage.abc.xyz.com”,
“sec-fetch-mode” → “navigate”,
“sec-fetch-site” → “same-origin”,
“sec-fetch-user” → “?1”,
“upgrade-insecure-requests” → “1”)
val headers_currentrevision = Map(
“accept” → “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”,
“accept-encoding” → “gzip, deflate, br”,
“accept-language” → “en-US,en;q=0.9”,
“cache-control” → “max-age=0”,
“referer” → “https://admin-stage.abc.xyz.com/en/node/add/big-page”,
“sec-fetch-mode” → “navigate”,
“sec-fetch-site” → “same-origin”,
“sec-fetch-user” → “?1”,
“upgrade-insecure-requests” → “1”)
val headers_Bigcontent = Map(
“accept” → “/”,
“accept-encoding” → “gzip, deflate, br”,
“accept-language” → “en-US,en;q=0.9”,
“referer” → “https://admin-stage.abc.xyz.com/en/content/test-drupal-content-0”,
“sec-fetch-mode” → “no-cors”,
“sec-fetch-site” → “cross-site”)
val headers_testDrupalContentAfterSaving = Map(
“accept” → “/”,
“accept-encoding” → “gzip, deflate, br”,
“accept-language” → “en-US,en;q=0.9”,
“if-modified-since” → “Tue, 18 Feb 2020 18:00:00 GMT”,
“referer” → “https://admin-stage.abc.xyz.com/en/content/test-drupal-content-0”,
“sec-fetch-mode” → “no-cors”,
“sec-fetch-site” → “cross-site”)
val scn = scenario(“Stage abc Site Baseline”)
.exec(http(“Log In”)
.post("/en/fiveprime3primewbc")
.headers(headers_fiveprime)
.formParam(“name”, “wz_ryan gruss”)
.formParam(“pass”, “dragon3”)
.formParam(“form_build_id”, “form-KU0StakJoFB8ijbpmBm8Jfsc11lzVrZPJ4LBlJ233QI”)
.formParam(“form_id”, “user_login”)
.formParam(“op”, “Log in”)
.check(status.is(302))
.check(bodyString.saveAs(“Login_Response”)))
.exec(http(“Add Big Page Save Content”)
.post("/en/node/add/big-page")
.headers(headers_0)
.body(RawFileBody("/Users/dast/Downloads/abcwebsitetests-CQ-1159-Self-Service-Perf-To-Use-Maven/src/test/resources/data/0000_request.dat"))
)
.exec(http(“Current Revision”)
.get("/en/node/1496326/current-revision")
.headers(headers_currentrevision)
.check(status.is(302)))
.pause(1)
.exec(http(“After Saving View Youtube Iframe”)
.get(uri2 + “/iframe_api”)
.headers(headers_Bigcontent))
.exec(http("After Saving View Draft Content ")
.get(uri5 + “?id=DC-9597311”)
.headers(headers_testDrupalContentAfterSaving))
setUp(
scn.inject(
constantConcurrentUsers(800) during(60))
.protocols(httpProtocol))
.maxDuration(60)
}