Hi Tony,
Really sorry for the late reply, was busy on other stuffs.
I have tried on windows and it worked with this command.
set JAVA_OPTS=-DuserCount=3 -DflowRepeatCount=3 -DdefinitionId=10201
now,
it gives me this error (its not getting the value of ‘definationid’ which I pass thru command line)
`
body=
{
“errors” : {
“error” : “Unexpected character (‘$’ (code 36)): expected a valid value (num
ber, String, array, object, ‘true’, ‘false’ or ‘null’)\n at [Source: org.apache.
catalina.connector.CoyoteInputStream@31e6639f; line: 1, column: 19]”
}
}
---- Errors --------------------------------------------------------------------
status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 400
`
Here is my code,
`
class TestCLI extends Simulation {
val userCount = Integer.getInteger(“userCount”, 1).toInt
val holdEachUserToWait = 2
val flowRepeatCount = Integer.getInteger(“flowRepeatCount”, 1).toInt
val definitionId = java.lang.Long.getLong(“definitionId”, 0L)
val testServerUrl = “Some URL”
val envAuthenticationHeaderFromPostman = “”“Basic UGVREXW87uY2V0ZXN0OlBlcmWRcmdhbmNldGODKDE=”“”
val httpProtocol = http
…
…
…
val headers_0 = Map(…
…)
val scn = scenario(“T”)
.repeat (flowRepeatCount) {
exec(http(“Test”)
.post(“”“/api/wfo”“”)
.headers(headers_0)
.body(StringBody(“”“{“definitionId”: $definitionId}”“”))) // <== I think it didnt get the value of definition ID
.pause(holdEachUserToWait)
}
setUp(scn.inject(atOnceUsers(userCount))).protocols(httpProtocol)
}
`
If I use ‘DefinationID’ value static(Define in code not passing thru cmd) it works fine, but doesn’t work with command line argument. Can u pls take a look?
Thanks.