Search code examples
parametersjmeter

Apacha Jmeter issue


how can I pass apikey in a header from the login response to the dashboard HTTP request?

I am getting 401 error{"response_code":401, "response_message": "Auth Key not Found", "result":[]}

when I try to fetch API in the dashboard.

I won't to pass that API key in the header so I can get the dashboard data.[401 error issue]

(https://i.sstatic.net/7ANg3NAe.png)


Solution

  • I fail to see any sign of the HTTP Header Manager, it might explain the behaviour.

    In case you're setting the header with Beanshell PreProcessor - take a look at jmeter.log file, it might be the case your script fails somewhere somehow

    Also be informed that starting with JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting so consider migrating. More information: Apache Groovy: What Is Groovy Used For?