【发布时间】:2019-04-23 09:11:05
【问题描述】:
我有以下代码
package lts
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class BankingSimulation extends BaseSimulation {
val paginateThroughCustomTransactionsView = scenario("Scenario 04: Paginate through custom transactions view")
.feed(csv("scenario04.csv").circular)
.exec(http("04_paginateThroughCustomTransactionsView")
.get("/api/savings/transactions?viewfilter=${viewEncodedkey}&offset=0&limit=50")
.header("accept", "application/json")
.check(jsonPath("$..encodedKey").saveAs("myEncodedKey"))
)
.asLongAs("${myEncodedKey.exists()}","offsetCounter", exitASAP = false) {
exec(http("04_paginateThroughCustomTransactionsView")
.get("/api/savings/transactions?viewfilter=${viewEncodedkey}&offset=${offsetCounter}&limit=50")
.header("accept", "application/json")
.check(jsonPath("$..encodedKey").saveAs("myEncodedKey"))
)
}
setUp(
paginateThroughCustomTransactionsView.inject(incrementConcurrentUsers(1).times(1).eachLevelLasting(1))
).protocols(httpProtocol)
}
目前该方案有效,但 offsetCounter 每次都增加 1。如何将其增加 50?
【问题讨论】:
标签: gatling scala-gatling