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

后端 未结 4 712
说谎
说谎 2021-02-04 21:08

I\'m a .net developer having no prior experience in JMeter/Stress testing. I\'m trying to load test the ASP.net website that I had developed using JMeter. The reason for using J

相关标签:
4条回答
  • 2021-02-04 21:34

    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

    0 讨论(0)
  • 2021-02-04 21:35
    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.
    0 讨论(0)
  • 2021-02-04 21:36

    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.

    0 讨论(0)
  • 2021-02-04 21:38

    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}

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