0
votes

I recorded some test script using BadBoy. Just simple steps "Login to a webpage" , "Click a button" and "Logout" .

Then I exported it as JMX file and then open it in JMeter.

When I run it, JMeter returns this 401 code.

Response code: 401
Response message: Unauthorized
Response headers:
HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/10.0
X-AspNetMvc-Version: 4.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET

Meanwhile, when I run it directly in BadBoy , It will return 200 code and green dot.

Do we need to modify something in JMeter? Can't we just use the JMX file generated by Badboy directly in JMeter ?

Thanks.

1
does generated script have a cookie manager? you may need to add it. also try to record script directly in JMeter, and see how it's different from generated.thiscommunityistoxic
@Kiril S. Yes, it has HTTP Cookie Manager HTTP Cache Manager User Defined Variables and HTTP Header Managerkeylogger

1 Answers

1
votes

Record and replay doesn't really work for the majority of the load testing tools as modern web applications use dynamic parameters for different reasons, i.e. saving the state of client page between requests, passing security tokens back and forth to protect from CSRF attacks, etc.

For ASP.NET web applications most likely you will need to deal with VIEWSTATE and occasionally EVENTVALIDATION settings. See ASP.NET Login Testing with JMeter article for more information on bypassing login challenges in ASP.NET web applications.

Also make sure you have HTTP Cookie Manager added to your Test Plan.