2016-09-23 24 views
0

如何将jsonPath结果保存为var作为JSON并重用到其他jsonPath查询?GATLING JSON保存和重用

请求:

var datas:Seq[String] = _ 
object Search{ 
    val search = exec(http("request_0") 
        .post(uriString) 
        .body(StringBody(requestJSON)) 
        .asJSON 
        .check(jsonPath("$..data[*]") 
        .saveAs("datas")) 
       ) 
} 

我已经试过类似...当然没有成功:

object Next{ 
    var current = datas.jsonPath("$..[?(@.id=='"+id+"')]") // ERROR : value jsonPath is not a member of Seq[String] 
    val next =exec(/*use current variable*/) 
} 

的想法是使用JSON输出在另一HTTP POST请求注入,像给料机。 thx

回答