除了使用正则表达式提取器之外,如何通过一种简单的方法有效地从响应中提取多个“视图状态”(将近50个)
步骤:
任何帮助都是真的。
我们可以通过将“ Match No”设置为“ -1”来使用正则表达式提取器,并使用在reg表达式提取器中设置的相同变量名并在采样器中使用它吗? 也有人可以告诉我如何设置变量名吗?
答案 0 :(得分:1)
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.