Hi,
My response returns “|0|hiddenField|__EVENTTARGET||0|hiddenField|__EVENTARGUMENT||0|hiddenField|__LASTFOCUS||7008|hiddenField|__VIEWSTATE|/wEPDwUKMTgyMzU4MzE3OA8WBB4N…”.
It’s seperated by “|” and I would like to extract the response to get some values and store them to session:
def postUpdatePanel(name: String, url: String) = http(name).post(url)
.check(
bodyString.transform(
_.map(
string => {
var viewStateResponse = string
var viewStateKeyWord = “|__VIEWSTATE|”
var startIndex = viewStateResponse.indexOf(viewStateKeyWord)
viewStateResponse = viewStateResponse.substring(startIndex + viewStateKeyWord.length,viewStateResponse.length-1)
var endIndex = viewStateResponse.indexOf("|")
viewStateResponse = viewStateResponse.substring(0,endIndex)
viewStateResponse
}
)
).saveAs(“viewState”),
bodyString.transform(
_.map(
string => {
var viewStateResponse = string
var viewStateKeyWord = “|__EVENTARGUMENT|”
var startIndex = viewStateResponse.indexOf(viewStateKeyWord)
viewStateResponse = viewStateResponse.substring(startIndex + viewStateKeyWord.length,viewStateResponse.length-1)
var endIndex = viewStateResponse.indexOf("|")
viewStateResponse = viewStateResponse.substring(0,endIndex)
viewStateResponse
}
)
).saveAs(“eventArgument”)
)
.param("""__VIEWSTATE""", “”"${viewState}""")
.param("""__EVENTARGUMENT""", “”"${eventArgument}""")
it’ just able to store “viewState”. With “eventArgument” it throws: “[ERROR] i.g.h.a.HttpRequestAction - No attribute named ‘eventArgument’ is defined”.
How can I achieve this?
Thanks in advance.