-1
我正在嘗試使用gatling測試REST API。使用gatling進行REST API測試:獲取狀態400
我配置都在我的gatling
腳本(scala),但我正在逐漸
11:54:41.466 [WARN ] i.g.h.a.ResponseProcessor - Request 'Top Speed' failed: status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 400
以下是我的代碼。
package computerdatabase
import io.gatling.core.Predef._
import io.gatling.core.session.Expression
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import scala.concurrent.duration._
class TopSpeedSimulation extends Simulation {
val httpConf = http.baseURL("http://192.168.0.10:23180/highresvu")
val headers_1 = Map("Content-Type" -> "application/vnd.com.wirelesscar.highresolution-vehicleutilization.hrvu.v1+xml")
val scn = scenario("My Scenario")
.exec(http("Top Speed")
.post("/topspeed")
.headers(headers_1)
.body(StringBody("""{"highResVehicleUtilization":
{"-xmlns": "http://wirelesscar.com/highresvu/highresvehicleutilization/1_0","request":{"vehicleDetails":{"vin": "RIGUD000000000057","chassisId":"RIGUD-000057"},"driveSessions":{ "driveSessionId": "1460453954" },"duration":{"fromDate": "2016-05-27T10:30:10.000Z","toDate": "2016-05-16T10:55:10.000Z"}}}}"""))
)
setUp(scn.inject(atOnceUsers(5)).protocols(httpConf))
}
嗨Naveen,歡迎來到SO。這只是一個警告。你遇到任何其他功能障礙?請更準確地說明您可能已更改的內容,以使其停止工作等等。 –