【发布时间】:2021-07-19 09:17:22
【问题描述】:
我正在尝试执行 doWhile,但我收到此编译错误:
特征循环中的方法 doWhile 缺少参数列表 只有在需要函数类型时,未应用的方法才会转换为函数。 您可以通过写
doWhile _或doWhile(_,_)(_)而不是doWhile来明确这种转换。
这是我的代码:
builder
.doWhile("${scrollId.exists()}") {
exec(http(s"$title")
.post(endpoint)
.headers(headers)
.body(ElFileBody(requestBodyFilePath))
.check(jsonPath("$.scrollId").saveAs("scrollId"))
.check(status.is(200)))
.pause(1)
//save value from response
.exec(session => {
.doIf(session("scrollId").asOption[String].isEmpty)
val scrollId = session("scrollId").asOption[String].get
session.set("scrollId", scrollId)
})
}
}
谢谢!
【问题讨论】: