(scala) Gatling headerRegex 抛出隐式值异常

(scala) Gatling headerRegex throws implicit value exception

我正在尝试 运行 加特林测试它登录并检查和存储 cookie 的值。

这是我的代码片段:

.pause(minWait, maxWait)
            .feed(usernames)
            .exec(
                http("_pLoginForm_Basic")
                    .post("${postUrl}")
                    .headers(headers_0)
                    .formParam("username", "${username}")
                    .formParam("password", "test123")
                    .check(status.is(200),
                        headerRegex("Set-Cookie", "viafoura_session_id")
                            .ofType[(String, String)]
                            .saveAs("vf_sess_id")
                    )
            );

登录和状态检查部分工作正常,但 headerRegex 在执行期间总是给我以下错误:

07:55:03.140 [main][ERROR][ZincCompiler.scala:141] i.g.c.ZincCompiler$ - /home/crengga/projects/vi-vinl/vinl-gatling/src/test/scala/nl/vi/gatling/simulation/OpenSessionsInitializer.scala:63: could not find implicit value for parameter extractorFactory: io.gatling.http.check.header.HttpHeaderRegexExtractorFactory

我的 gatling (scala) 中是否遗漏了一些导入 class?

我一直在互联网上搜索错误,但到目前为止我能找到的都是一般的 Scala 帖子(不是特定于 gatling),我对 scala 的了解有限。

错误原来是导​​入 类 的错误方式。由于我依赖 intellij 的自动导入,它没有导入所有需要的 类.

以前是这样的:

import io.gatling.http.Predef.{currentLocationRegex, headerRegex, http, regex, responseTimeInMillis, status}

然后我改成了

import io.gatling.http.Predef._