Hi Stephane,
Dependency issue has been solved. Thanks for your help.
We got another problem, the session is not shareable to scenarios. We want 9 users log in first, 5 users constantly do the deal entry for 30min, after 30mins 2 users logoff with the pacing of 30seconds.
When running the simulation the dealEntry scenario getting the error 20:53:13.491 [ERROR] i.g.h.a.HttpRequestAction - ‘httpRequest-9’ failed to execute: No attribute named ‘token’ is defined
I have shared the code :
class DealEntrySimulation extends Simulation with BaseTrait {
//loading the user feeders
val userFeeder = csv(BaseConstants.FX_DL_USERS).circular
//loading the user feeders
val dataFeeder = csv(BaseConstants.FX_DL_DATA).circular
// Login Users
val loginScenario = scenario(BaseConstants.FX_DL_LOGIN_SCENARIO)
.feed(userFeeder)
.exec(http(BaseConstants.LOGINACCESS)
.post( secUrl+ BaseConstants.LOGINURL)
.headers(secureHeaders)
.check(status.is(200))
.check(jsonPath(BaseConstants.ACCESS_TOKEN_JSON_KEY).saveAs(BaseConstants.TOKEN)))
.pause(20)
val httpApiProtocol=http.baseUrl(appUrl)
//Loading Deal Entry Body Json from file
var dealScenario=scenario(BaseConstants.FX_DL_SCENARIO)
.feed(dataFeeder)
.exec(session=>
session.set(BaseConstants.SIGNONBRANCH, signOnBranch).set(BaseConstants.BPD, BPD)
)
.exec(http(BaseConstants.FX_DL_SCENARIO)
.post( appUrl+ BaseConstants.FX_DL_URI)
.header(BaseConstants.TRADE_ACCESS_TOKEN,BaseConstants.TOKEN_VAR_KEY) //"${token}" error in this line No attribute named ‘token’ is defined
.body(ElFileBody(BaseConstants.FX_DL_BODY_JSON))
.asJson.check(status.is(200)))
.pause(10)
//Logout the users
var logoutScenario=scenario(BaseConstants.FX_DL_LOGOUT_SCENARIO)
.exec(http(BaseConstants.LOGOUTACCESS)
.post(secUrl+BaseConstants.LOGOUTURL)
.header(BaseConstants.ACCESS_TOKEN,BaseConstants.TOKEN_VAR_KEY) //"${token}" error in this line No attribute named ‘token’ is defined
.check(status.is(200))).pause(20)
setUp(
loginScenario
.inject(rampUsers(9).during(30)).andThen( dealScenario.inject(constantUsersPerSec(5).during(15)).throttle(
reachRps(2) in (20 seconds),
holdFor(5 minutes))
.andThen(logoutScenario.inject(constantUsersPerSec(2).during(30))))
)
}
Plesae let me any solution around problem.
Regards,
Umeshwaran.V