我正在通过Taurus运行Gatling,使用以下yaml配置查询一些REST端点
execution:
- executor: gatling
concurrency: 1
hold-for: 30s
ramp-up: 3s
scenario: Thread Group
scenarios:
Thread Group:
requests:
- label: demo
method: GET
url: https://Cname/health
assert:
- contains:
- “healthy”
subject: body
regexp: true
not: true而且它在所有测试中都返回200 -耶!但是,当我将"healthy“替换为"someText”时,它仍然返回200 :(。我怀疑它不是在执行断言条件,而只是验证是否存在端点。如果您有任何见解,我将不胜感激。
发布于 2019-02-06 18:13:46
正确的答案包括编写一个包含场景的单独脚本。这可以注入到代码中以查询响应,如下所示。
val scn = scenario("check return details")
.exec(http("check the actual return ")
.get("urlLocation")
.check(jsonPath("$.friendlyName").is("testName"))) https://stackoverflow.com/questions/54535159
复制相似问题