0
我使用JSON有效負載進行了很多HTTP請求,並且正在爲每個請求讀取一個文件以獲取JSON有效負載,如下所示。Gatling: - 從單個文件中讀取多個JSON有效負載
postPayload1 = val postPayload = ElFileBody("Test_case1.json")
val TC1 = feed(accountNumberFeeder1)
.exec(http(testCase1).post(appendPathToUrl).headers(common_header).body(postPayload).asJSON
.check(status.is(200)
)
但是,它現在變成我的資源目錄中的很多JSON文件。因此,我可以將所有JSON合併到一個文件中,如下所示。
{"testCase1":{
"activationSource": "HH",
"accountStatus": null,
}
}
{"testCase2":{
"activationSource": "HH",
"accountStatus": null,
}
}
並使用我的密鑰「testCase1」,「testCase2」等訪問它?
val postPayload = ElFileBody("Test_case.json")