Home > Net >  performance testing with jmeter using auth which has a token
performance testing with jmeter using auth which has a token

Time:11-02

I have rest api which has token in header, but i'm having trouble performing with response data because api have to request token, where should i store my token in jmeter?

CodePudding user response:

  1. If you just have the token and looking for a way to add it to the request(s) - it can be done via enter image description here

  2. If you need to authenticate/authorize first than you can implement the authorization logic using JMeter's HTTP Request samplers first and once you get the token in the response you can extract it from there using a suitable JMeter Post-Processor and save it into a JMeter Variable.

    Then in the HTTP Header Manager you will be able to use the JMeter Variable extracted by the Post-Processor. See Using Regular Expressions to Extract Tokens and Session IDs to Variables article for example implementation

  • Related