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 JMeter is that its an open source tool having lots of fame and credibility.
I referred to this link in order to take care of viewstate which is a typical feature of ASP.net. However my requirements are not that simple as stated there. I'm trying to load test my site by sending userid and password to log-in page and then test through other pages which are allowed to be browsed only if log-in is successful.
The steps that I'm taking to achieve this are listed below.
- Create Http Proxy Server by selecting WorkBench > Add > Non-Test Elements.
- Changing the network settings in Firefox to the port defined in Http Proxy Server.
- Creating a
Thread Group
by selecting Test Plan > Add > Threads(Users) > Thread Group. - Creating
HTTP Request Defaults
by selecting Thread Group > Add > Config Element > HTTP Request Defaults. - (a) Entering IP for my remote server in
Server Name or IP:
(b) Entering the path to my log-in page as/MyWebApplication/login.aspx
- Create
User Defined Variables
by selecting Thread Group > Add > Config Element > User Defined Variables. My login.aspx page is very simple, it takes userid and password from two text-boxes and match them in database and if successful, redirects them to LoginSuccess.aspx page.
My login.aspx has three server controls only, twoasp:TextBox
for receiving loginid and password and oneasp:Button
for checking them in db.
The id of them aretxtLogin
,txtPassword
,btnLogin
respectively.In User Defined variables (created in step 6), I've added admin and 123admin, which are real logins in db getting checked in login.aspx page and on success is redirecting to LoginSuccess.aspx page.
User defined variables:
Name: Value Description login admin password 123admin
I'm adding two Regular Expression Extractor by selecting Thread Group > Add > Post Processors > Regular Expression Extractor.
I've renamed the 1st Regular Expression Extractor as
View State Extractor
and adding following data to them:Reference Name: viewstate Regular Expression: name="__VIEWSTATE" id="__VIEWSTATE" value="(.+?)" Template:$1$ Match No.(0 for Random): 1 Default Value: ERROR
Similarly I've renamed the 2nd Regular Expression Extractor as
Event Validation Extractor
and adding following data to them:Reference Name: eventValidation Regular Expression: name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.+?)" Template:$1$ Match No.(0 for Random): 1 Default Value: ERROR
In step 5 I added following data
Send Parameters With the Request: Name: - Value txtLogin - $(login) txtPassword - $(password) __VIEWSTATE - $(viewState) __EVENTVALIDATION - $(eventValidation)
Now I added HTTP Cookie Manager by selecting Thread Group > Add > Config Element > HTTP Cookie Manager.
Now I added Recording Controller by selecting Thread Group > Add > Logic Controller > Recording Controller.
I started HTTP Proxy Server and then using firefox entered the complete URL to my login.aspx page, entered admin and 123admin in the two text boxes and pressed the Login button and got redirected successfully on LoginSuccess.aspx. I stopped the HTTP Proxy Server and closed my firefox browser.
Now I've saved the test plan (containing the recorded steps, just 2 steps here, 1 for login.aspx and another for LoginSuccess.aspx) and running the test and viewing the test result in View Result Tree which is returning 500 error from the server.
I'm unable to determine what ingredient I'm missing here because of which I can't successfully use JMeter. I've only changed those values which are mentioned here and for everything that I didn't write here the values are default type like No of thread:
.