Reputation: 119
How to Extract Multiple "View State" (almost 50) from the Response effectively and in a simple way other than using the regular expression extractor
Step:
Any help would be really appreciable.
Can we regular expression extractor by setting "Match No" as "-1" and use same variable name set in the reg expression extractor and use it in sampler? Also could anyone please tell how to set the variable name too ?
Upvotes: 0
Views: 385
Reputation: 168092
My expectation is that VIEWSTATE is a hidden input so you can automate handling of this VIEWSTATE parameters like:
Add CSS Selector Extractor to fetch hidden inputs names like:
Add another CSS Selector Extractor to fetch hidden inputs values like:
Add JSR223 PreProcessor as a child of the next request and put the following code into "Script" area:
1.upto(vars.get('hiddenInputName_matchNr') as int, { index ->
def hiddenInputName = vars.get('hiddenInputName_' + index)
if (hiddenInputName.startsWith('__VIEWSTATE')) {
sampler.addArgument(hiddenInputName, vars.get('hiddenInputValue_' + index))
}
})
That's it, the JSR223 PreProcessor should add all the VIEWSTATE parameters to the request in the runtime.
Upvotes: 1