How to fix 401 error for aspx API in jmeter?

26 Views Asked by At

I am preparing a jmeter script for SQL server report services. I am able to execute the script for other operations like login but I am unable to execute the API which is specifically generated for the Report. The API is in .aspx extension and shows 401 error code in view results tree

First I added 1 HTTP Header Manager in the script by which my login operation started working fine, but still the report API is not working which is .aspx extension.

I am expecting that the APIs with any extension(.aspx,.axd etc) should work in jmeter successfully so that the performance of report can be monitored on SSRS Reports.

1

There are 1 best solutions below

0
Dmitri T On

Use View Results Tree listener to inspect responses, especially for "operations like login" as it might be the case your login operation fails and you're just hitting the login page all the times.

The steps are:

  1. Add HTTP Cookie Manager to your Test Plan
  2. Check if your recorded script contains dynamic parameters which need to be correlated. For ASP web applications most probably they're ViewState and/or EventValidation. They need to be extracted from the previous response using suitable Post-Processors and you should replace recorded hard-coded value with the variables from the Post-Processors. See How to use JMeter for Login Authentication article for example challenge and solution