(斯卡拉)加特林headerRegex抛出隐含值异常
问题描述:
我试图运行加特林测试它登录并检查和存储cookie的值。(斯卡拉)加特林headerRegex抛出隐含值异常
下面的代码片段,我有:
.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
上午我在加特林(scala)课上缺少一些进口产品?
我一直在寻找有关错误在互联网上,但到目前为止,我能找到的是一般的Scala柱(未加特林具体的),和我的斯卡拉的知识是有限的。
答
错误是原来是进口类的错误的方式。因为我依靠的IntelliJ的汽车进口,并没有导入所有必需的类。
以前是这样的:
import io.gatling.http.Predef.{currentLocationRegex, headerRegex, http, regex, responseTimeInMillis, status}
,我把它改成
import io.gatling.http.Predef._
嘿,你可以请尝试删除_.ofType [(字符串,字符串)] _从代码和检查错误是否仍然出现? – Eugene
是错误仍然出现 – sirhc