Я смог вызвать вложенный запрос на 2-х уровнях, но на третьем уровне он не выполняется, так что я делаю это правильно или нет, если нет, то как правильно выполнить вложенный запрос на основе ответа
Вот мой код, который я использовал
import scala.concurrent.duration._
import java.net.{URLDecoder, URLEncoder}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class NestedRequestResoponse extends Simulation {
val scn = scenario("NestedRequestResoponse ")
.exec(http("request_2")
.post("https://myurl:443/autho/login/login.html""")
.formParam("""userid""", """userName""")
.formParam("""password""", """password""")
.formParam("""target""", """""")
.formParam("""smauthreason""", """""")
.formParam("""smquerydata""", """""")
.formParam("""smagentname""", """""")
.formParam("""postpreservationdata""", """""")
.formParam("""SMENC""", """""")
.formParam("""SMLOCALE""", """""")
.check(currentLocation.transform(s => {
val locationRegex = """.*/autho/fed/(.*)/.*""".r
val locationKey = locationRegex findFirstIn s
URLDecoder.decode(locationKey.get.replace("somepath/to/replace", ""), "UTF-8")
}).saveAs("redirectURL") )
.resources(
http("request_3 ${redirectURL}")
.get("https://go.to.this.url:443${redirectURL}")
.check(currentLocation.transform(s => {
val locationRegexN = """.*/*/.*""".r
val locationKeyN = locationRegexN findFirstIn s
URLDecoder.decode(locationKeyN.get, "UTF-8")
}).saveAs("pingURL") )
.resources(
http("request_4 ${pingURL}").get("${pingURL}").check(status.is(200))
)
))
}
Итак, здесь я не могу выполнить "request_4", пожалуйста, подскажите мне правильный способ сделать это.