【发布时间】:2018-09-25 19:57:07
【问题描述】:
我有一个接受特定格式 XML 的端点。我正在尝试在提要的 XML 文件上使用与循环类似的功能。我可以用 CSV 文件做到这一点,但我似乎无法用 XML 文件做到这一点。这甚至可以做到吗?
我也读过这个:https://gatling.io/docs/3.0/session/feeder/?highlight=feeder#file-based-feeders
我在 gatling 方面也很新,到目前为止只写过一个负载测试。
这是我的示例代码:
object ProcessXml {
val createProcessHttp = http("Process XML")
.post("/myEndpointPath")
.body(RawFileBody("data/myXml.xml"))
.asXML
.check(status is 200)
val createProcessShipment = scenario("Process Shipment XML")
.feed(RawFileBody("data/myXml.xml).circular) // feed is empty after first user
.exec(createProcessHttp)
}
由于某种原因,csv 的 .feed() 参数有效(csv(Environment.createResponseFeedCsv).circular;其中 createResponseFeedCsv 在我的环境文件中的 utils 下定义)。
对于这个问题的任何帮助将不胜感激。 提前致谢。
【问题讨论】:
标签: xml scala load-testing gatling scala-gatling