inferHtmlResources throwing error when passing Whitelist & Blacklist

139 views
Skip to first unread message

sandeep kumar

unread,
Feb 27, 2021, 5:58:02 AM2/27/21
to Gatling User Group
Gatling version: 3.4.2
Scala: 2.12

My http configuration:

val httpConf = http .maxConnectionsPerHostLikeChrome
.baseUrl(BASE_URL)
.inferHtmlResources(BlackList, WhiteList(BASE_URL+"/*")) .headers(headers) .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36")
.disableCaching

The inferHtmlResources usage here is throwing an error

found : String
required: io.gatling.core.session.Session

.inferHtmlResources(BlackList, WhiteList(BASE_URL)) ^ 20:23:19.820 [ERROR] i.g.c.ZincCompiler$ - one error found 20:23:19.825 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed

My code seems to be inline with the gatling documentation here

Can anyone point me why I am getting this error and how can I fix this. Thank you.

Stéphane LANDELLE

unread,
Feb 27, 2021, 9:27:19 AM2/27/21
to gat...@googlegroups.com
I suspect you've removed or broken the required imports, in particular:

import io.gatling.core.Predef._

Logo Stéphane Landelle
Chief Technical Officer
twitter: @slandelle
site:
gatling.io




--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/dff66281-a0d6-4c70-8d08-3d4d8e02a261n%40googlegroups.com.

sandeep kumar

unread,
Mar 1, 2021, 1:30:53 AM3/1/21
to Gatling User Group
Thanks for the response. Following your suggestion, I played with the imports. In particular changed the order these imports to this from what was earlier and it started working

import io.gatling.http.Predef._
import io.gatling.core.Predef.{rampUsers, _}

Stéphane LANDELLE

unread,
Mar 1, 2021, 2:50:43 AM3/1/21
to gat...@googlegroups.com
This is broken, you should only have import io.gatling.http.Predef._


Logo Stéphane Landelle
Chief Technical Officer
twitter: @slandelle
site:
gatling.io



Reply all
Reply to author
Forward
0 new messages