How to use JMeter for load testing ASP.net web applications implementing viewstate

强颜欢笑 提交于 2019-12-03 00:44:42
  1. Please add better schema of your script at least.
  2. Well, in step 11 above you have txtLogin = $(login), txtPassword = $(password), ...
    Referring variable value as $(VAR_NAME) is incorrect, ${VAR_NAME} should be used.
    Can you ensure if that only misspelling in your question - or you have the same in the script?
  3. Use e.g. Debug Sampler / Debug PostProcessor (inserted after both RegEx Extractors applied) to check that values for both viewstate and eventValidation were extracted from your request and your regex queries work correctly.
  4. Look into the Request panel of your 2nd HTTP Request sampler in View Result Tree results to ensure that all the defined params (txtLogin, txtPassword, __VIEWSTATE, __EVENTVALIDATION) with correct values are sent along with request.
Jmeter PerfTest

In step 5, change as follows

Name:             - Value
txtLogin          - ${login}
txtPassword       - ${password}
__VIEWSTATE       - ${viewState}
__EVENTVALIDATION - ${eventValidation}

Also verify, regular expression extractor is working as required. I mean check if it is fetching correct values.

I used CSS/JQuery Extractor and it worked for me. With regex extractor for view state {viewState} variable was getting passed and got view state corrupt error message.

parameters to be set in CSS/JQuery extractor are :-

Reference Name: viewState

CSS/JQuery Expression: input[id=__VIEWSTATE]

Attribute: value

The steps i followed are :-

  1. First do recording of login process.
  2. Drag the required pages in thread group.
  3. In get request of login page add two CSS/JQuery extractor for view state and event validation each.
  4. In post request of login page add body parameters as follows and run the batch.

    Name: - Value

    txtLogin - ${login}

    txtPassword - ${password}

    __VIEWSTATE - ${viewState}

    __EVENTVALIDATION - ${eventValidation}

Http 500 is. A server error code so it is not your script that's is failing what has to be done is a tag in the .aspx to disabled the security I faced this some months ago

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!