Holm
Holm

Reputation: 3355

Gatling tansformOption type mismatch

I follow the document to use tansformOption https://gatling.io/docs/3.0/http/http_check/#transforming

jsonPath("$.._links..next..href")
.transformOption(extract => extract.orElse(Some("default")).success)
.saveAs("next"))

but it complains about type mismatch. it says it has to be Validation My gatling is 3.x which is the same as the document, and scala version 2.12.8.

Upvotes: 0

Views: 194

Answers (1)

Holm
Holm

Reputation: 3355

I made a mistake in the imports. Be sure you have the correct imports

import io.gatling.core.Predef._
import io.gatling.core.session.Expression
import io.gatling.core.structure.{ChainBuilder, ScenarioBuilder}
import io.gatling.commons.validation._
import io.gatling.http.Predef._

Upvotes: 1

Related Questions