在我的加特林测试中,我有此测试:
val HorizonPost: ChainBuilder = exec(
http("Horizon Post")
.post(getRouteInfoURI).basicAuth(s"${{EnvValues.RoadsApi_Username}}", s"${{EnvValues.RoadsApi_Password}}")
.body(ElFileBody("bodies/horizonPost.json")).asJson
.check(status.is(200))
)
似乎'current_timestamp'有问题,并出现此错误:
body=
The request content was malformed:
Text '{{$current_timestamp}}' could not be parsed at index 0
有人可以解释我需要更改的内容吗?我对加特林还比较陌生。
如果您尝试使用Scala string interpolation,则正确的语法是s"${foo}"
,而不是s"${{foo}}"
。
[如果您尝试使用Gatling Expression Language,则正确的语法是"${foo}"
(没有s
),而不是s"${{foo}}"
。