ZincCompiler error when using 'whatever' in check

Using Gatling 2.1.7, am getting a compiler error using “.whatever”:

14:36:41.466 [ERROR] i.g.c.ZincCompiler$ - …scala:25: value whatever is not a member of io.gatling.core.check.ValidatorCheckBuilder[io.gatling.http.check.HttpCheck,io.gatling.http.response.Response,CharSequence,String]

possible cause: maybe a semicolon is missing before `value whatever’?

14:36:41.469 [ERROR] i.g.c.ZincCompiler$ - .whatever

14:36:41.470 [ERROR] i.g.c.ZincCompiler$ - ^

14:36:41.758 [ERROR] i.g.c.ZincCompiler$ - one error found

Snippet of my code:

def extractLink(): HttpCheck = {

regex( “”"<a [^>]*href="([^#"]+)""")

.findAll
.transform(s => util.Random.shuffle(s).head)
.whatever
.saveAs(“link”)
}

def getCheckPause(actionName: String, url : String): ChainBuilder = {
exec(http(actionName).get(url).check(extractLink)).pause(5 seconds)
}

Removing the .whatever line and it works fine (though errors when it doesn’t find any links that match the regex - which I’d like to not count as a KO)

Thanks,
Rob

Hi,

http://gatling.io/docs/2.1.7/project/migration_guides/1.5.x-to-2.0.html#checks : whatever has been renamed to optional for a very long time :slight_smile:

Thanks - I was clearly looking at the old documentation.

THANKS!

It was renamed again in 2.1, see 2.0 to 2.1 migration guide then :wink: