I am unable to pass Saved values in formParam

Hi,
I have saved
'current_account_id' and 'current_workspace_id'

in below code. Want to use those IDs in next request as I have to make it dynamic so I replaced “505520” with “${accountID}” and “505519” with “${workspaceID}” but it doesnt work and throws "No attribute named ‘accountID’ is defined"

However it works on ‘Logout’ request. Can anyone tell how to solve this?

`
.exec(http(“Login”)
.post("/j_security_check")
.headers(headers_9)
.formParam(“j_username”, username + ThreadLocalRandom.current.nextInt(endNum))
.formParam(“j_password”, password)
.resources(
http(“Fetch_IDs”)
.get("/desktop/side_nav.jsp")
.check(regex(""“current_account_id=(\d+)”"").saveAs(“accountID”))
.check(regex(""“current_workspace_id=(\d+)”"").saveAs(“workspaceID”))
.headers(headers_5),
http(“request_11”)
.get("/desktop/dashboard/index.jsp")
.headers(headers_5),
http(“request_12”)
.get("/global_nav.jsp")
.headers(headers_5),
http(“request_13”)
.post("/eventDataController")
.headers(headers_9)
.formParam(“action”, “viewevents”)
.formParam(“objectId”, “”)
.formParam(“type”, “Desktop”)
.formParam(“dashboardType”, “desktop_events”)
.formParam(“forceReplace”, “true”)
// Doesnt work
.formParam(“current_account_id”, “${accountID}”)
.formParam(“current_workspace_id”, “${workspaceID}”)
.formParam(“skipAccountCheck”, “”)
.formParam(“skipWorkspaceCheck”, “”),
http(“request_14”)
.post("/savedsearchdatacontroller")
.headers(headers_9)
.formParam(“action”, “dashboard_view”)
.formParam(“dashboardType”, “Desktop”)
.formParam(“current_account_id”, “505520”)
.formParam(“current_workspace_id”, “505519”),
http(“request_15”)
.post("/wizardDataController")
.headers(headers_9)
.formParam(“action”, “view”)
.formParam(“current_account_id”, “505520”)
.formParam(“current_workspace_id”, “505519”)))

.exec(http(“Logout”)
.post("/logoutcontroller")
.headers(headers_9)
.formParam(“action”, “logout”)
.formParam(“undefined”, “”)
//Here it works and fetches value
.formParam(“current_account_id”, “${accountID}”)
.formParam(“current_workspace_id”, “${workspaceID}”)
)
`

Thanks.

Try this

replace: "${accountID}"

with: _.get(“accountID”).as[String]

Here is a snippet from my code that works:

def login = group("Auth.login") {
    exec(http("Login")
      .post("/j_acegi_security_check")
      .formParam("j_username", _.get("currentUserName").as[String])
      .formParam("j_password", performanceUserCommonPassword)
      .formParam("submit", "Login")
      .check(currentLocationRegex("^.*failed=true.*$").count.is(0))
    )
}

Hi peter
I have the same issue as you, do you solve the issue?

Thanks,
Tracy