【问题标题】:Gatling - Taurus querying resultsGatling - Taurus 查询结果
【发布时间】:2019-02-05 13:09:11
【问题描述】:

我正在通过 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 :(。我怀疑它没有执行断言条件,而只是验证是否存在端点。任何见解都将不胜感激?

【问题讨论】:

    标签: kubernetes gatling taurus


    【解决方案1】:

    正确的答案涉及编写包含场景的单独脚本。这可以注入到代码中以查询响应,如下所示。

      val scn = scenario("check return details") 
        .exec(http("check the actual return ") 
          .get("urlLocation") 
             .check(jsonPath("$.friendlyName").is("testName"))) 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-16
      • 1970-01-01
      • 2023-03-10
      • 2016-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多