Hi All,
We try to use gatling for our testing driver to replace the old one, but I encounter one problem:
The requirement from my testing of login logic, which is some complex
The login has two part of redirect, for 1st redirect, I need to disableFollowRedirect as I need to find token in the redirected page:
group(“LoadLoginPage”) {
exec(
http(“req1”)
.get(host + “/” + contextRoot)
.check(status.is(302))
.check(header(“Location”).saveAs(“nextRedirectURL”))
)
.exec(
http(“req2”)
.get("${nextRedirectURL}")
.check(status.is(200))
.check(regex(“token = ‘(.+?)’;”).saveAs(“token”))
)
}
Then in next chains of redirect, I need to set disableFollowRedirect as false, as I need the server to do the redirect to another host for 3rd party authorization instead of gatling as client, the chain disableFollowRedirect = true as below
exec(
http(“reg3”)
.post("${nextRedirectURL}")
.formParam(“login”, “${username}”)
.formParam(“password”, “${password}”)
.formParam(“token”, “${token}”)
.check(header(“Location”).saveAs(“nextRedirectURL”))
)
.exec(http(“req4”)
.get("${nextRedirectURL}")
.check(header(“Location”).saveAs(“nextRedirectURL”))
)
.exec(
http(“reg5”)
.get(“nextRedirectURL”)
.check(status.is(200))
)
)
I checked the documents, seems no way to resovle it? So ask here whether I can implement this in some way? Thanks!