Load testing using jmeter with basic authentication

ぐ巨炮叔叔 提交于 2020-01-06 15:06:06

问题


My goal is to perform Load testing in jmeter for number of users. The application being in test is using ‘Basic Authentication‘ method at the login page and its URL has few parameters that are related to the login user. So how can I perform load testing for e.g. 100 users where as url is customized for the login user??


回答1:


Your question is basically for doing authentication / login process via JMeter. Number of users are irrelevant in context of this question. Once you have a working Test Plan, you can use as many number of users as you want. But for that, you must first send valid authentication/login requests using JMeter.

This process could vary depending on security protocols / technologies used by your application. Since you have not shared that info. So I am sharing general steps to do this process.

  1. Record your login scenario in JMeter via JMeter Recording Controller https://www.digitalocean.com/community/tutorials/how-to-use-jmeter-to-record-test-scenarios

  2. Make sure that you have added following in your test plan

    • Cookie Manager
    • Header Manager
    • Cache Manager
  3. After recording your login scenario, identify the requests where the login parameters were sent. Also identify if any additional authentication checks were sent along with login parameters.

  4. Now parameterize the parameters that you identified in previous step. You might need developers help here (if there are additional security checks in login process). For parameterization you can use CSV data in JMeter.

  5. Use debug sampler and Tree view listener to verify the content of requests/responses. Ensure the successful login by checking response of login request. You can use Jmeter assertion for that.

It could be quite complicated process but there is lot of helpful content on this topic in form of blogs/ tutorial videos etc.

For start you can check the below links.. http://www.communardo.de/home/techblog/2010/12/27/liferay-performance-testing/ https://blazemeter.com/blog/how-use-http-basic-authentication-jmeter




回答2:


Don't pass username and password via URL string, it is not secure, use HTTP Authorization Manager instead.

You can use CSV Data Set Config in order to parametrize username/password pairs in the HTTP Authorization Manager.



来源:https://stackoverflow.com/questions/34251195/load-testing-using-jmeter-with-basic-authentication

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