代码之家  ›  专栏  ›  技术社区  ›  sirhc

(scala)Gatling headerRegex引发隐式值异常

  •  1
  • sirhc  · 技术社区  · 8 年前

    .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")
                        )
                );
    

    登录和状态检查部分工作正常,但是 在执行过程中始终给我以下错误:

    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
    

    我在我的加特林(scala)班上错过了一些进口货吗?

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

    1 回复  |  直到 8 年前
        1
  •  1
  •   sirhc    8 年前

    这个错误被证明是导入类的错误方式。因为我依赖intellij的自动导入,所以它并没有导入所有需要的类。

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

    我把它改成了

    import io.gatling.http.Predef._
    
    推荐文章