我已阅读以下有关 csv 解析的文档。 http://gatling.io/docs/2.0.1/session/feeder.html#feeder
我仍然无法捕获以下实现:
- 如何在 Scala 中创建变量,表示 csv 文件中的每一列?
- 如果我有 2 个用户依次运行,Gatling 如何为这两个用户解析 CSV 文件?它会在第一个值被解析后自动查找下一个值吗?
我想要达到的目标:
- Gatling 读取包含 SIM 序列号和原因详细信息的 CSV 文件,由变量“SimSerial”和“ReasonID”表示
CSV 文件的值被插入到下面代码所示的参数中
package sim_replacement import scala.concurrent.duration._ import io.gatling.core.Predef._ import io.gatling.http.Predef._ import io.gatling.jdbc.Predef._ import io.gatling.core.feeder._ class shakeout3a extends Simulation { val serialNumReasonID= csv("search2.csv") val scn = scenario("shakeout3") .group("5. Check SIM model"){ exec(http("request_24") .post("""/SimReplacement/CheckSimModel""") .headers(headers_24) .formParam("""sim""", """${SimSerial}""") .resources(http("request_25") .post(uri2 + """/SIMReplacement/GetReasonDetails""") .headers(headers_25) .formParam("""strReasonId""", """${ReasonID}""") }}