How to Extract Multiple “View State” (almost 50) from the Response effectively and in a simple way other than using the regular expression extractor

后端 未结 1 1131
遥遥无期
遥遥无期 2021-01-16 23:16

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:

相关标签:
1条回答
  • 2021-01-16 23:37

    My expectation is that VIEWSTATE is a hidden input so you can automate handling of this VIEWSTATE parameters like:

    1. Add CSS Selector Extractor to fetch hidden inputs names like:

    2. Add another CSS Selector Extractor to fetch hidden inputs values like:

    3. 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))
          }
      })
      

    4. That's it, the JSR223 PreProcessor should add all the VIEWSTATE parameters to the request in the runtime.

    0 讨论(0)
提交回复
热议问题