Scala Gatling tansformOption类型不匹配

Scala Gatling tansformOption类型不匹配,scala,gatling,Scala,Gatling,我按照文档使用tansformOption jsonPath(“$..链接..下一个..href”) .transformOption(extract=>extract.orElse(部分(“默认”)).success) .saveAs(“下一个”)) 但它抱怨类型不匹配。它说它必须是验证 我的gatling是3.x,与文档相同,scala版本是2.12.8。我在导入时犯了一个错误。确保您有正确的导入 导入io.gatling.core.Predef_ 导入io.gatling.core.s

我按照文档使用
tansformOption

jsonPath(“$..链接..下一个..href”)
.transformOption(extract=>extract.orElse(部分(“默认”)).success)
.saveAs(“下一个”))
但它抱怨类型不匹配。它说它必须是
验证

我的gatling是3.x,与文档相同,scala版本是2.12.8。

我在导入时犯了一个错误。确保您有正确的导入

导入io.gatling.core.Predef_
导入io.gatling.core.session.Expression
导入io.gatling.core.structure.{ChainBuilder,ScenarioBuilder}
导入io.gatling.commons.validation_
导入io.gatling.http.Predef_