请求失败400 |加特林2.2.5

时间:2017-07-03 08:49:26

标签: scala gatling scala-gatling

我正在使用Gatling工具进行API的负载测试。我想过将进程隔离到Objects中。但是当我运行我的场景时,我得到以下错误:

Simulation testapi.AdvancedSimulationStep05 started...
14:12:50.981 [WARN ] i.g.h.a.ResponseProcessor - Request 'PostMultiline' failed: status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 400
14:12:50.981 [WARN ] i.g.h.a.ResponseProcessor - Request 'PostMultiline' failed: status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 400

以下是我的Scala模拟代码:

class AdvancedSimulationStep05 extends Simulation {

  object Search {

    val search = exec(
            http("PostMultiline")
            .post("/t_rates/v1/quotations")
            .header("Content-Type", "application/json")
            .body(RawFileBody("test.json")).asJSON
        )
  }

  val httpConf = http
    .baseURL("https://central-us.rates")
    .acceptHeader("application/json, */*")
    .acceptCharsetHeader("UTF-8")

  val users = scenario("Users").exec(Search.search)
  val admins = scenario("Admins").exec(Search.search)

  setUp(
    users.inject(rampUsers(10) over (10 seconds)),
    admins.inject(rampUsers(2) over (10 seconds))
  ).protocols(httpConf)
}

我尝试了几种运行模拟的组合,但我仍然得到错误。如果我从专家那里得到一些建议,那就太好了。

0 个答案:

没有答案