0

I have Test plan where the User Logins and recieves an authcode which I am capturing in a variable authcode the following requests have to be made using the authcode as an header value eg: Cookie X-Tr-Auth=${authcode}

I have set the following in HTTP Header Manager

Content-Type: application/json

Accept-Encoding: gzip,deflate,sdch

Accept-Language: en-US,en;q=0.8

Cookie: X-Tr-Auth=${authcode}

But the request does not show any Cookie field, all the other fields are shown. Am i missing something?

Please see the request Body:

POST http://xx.xx.xx.xxx:8080/xxx

POST data: \"xxxxx\":{\"xx\":\"xx\",\"x\":\"xxxxxx\",\"x\":{\"Tickers\":[\"xxxx.x\",\"xxxx.x\",\"xxx.N\",\"xxx.N\",\"xxx.N\",\"xxxx.xx\"]}}}

[no cookies]

Request Headers: Connection: keep-alive Content-Type: application/json Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Content-Length: 134 Host: 10.248.70.205:8080 User-Agent: Apache-HttpClient/4.2.6 (java 1.5)

This request is failing with 401 Unathorised error. Experts please help!

Compass
  • 5,867
  • 4
  • 30
  • 42
Powell Mittra
  • 71
  • 4
  • 15
  • Try the steps mentioned in http://stackoverflow.com/questions/27313024/unable-to-capture-alpha-numeric-data-using-regular-expression-extractor-in-jmete – Guru Dec 08 '14 at 09:24

1 Answers1

0

You need to use HTTP Cookie Manager, not HTTP Header Manager to set/override cookies.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I tried the HTTP cookie manager but it dint worked. I have the following configuration in cookie manager Name: authcode Value: Cookie X-Tr-Auth=${authcode}; HttpOnly Domain: http://10.248.70.204:8080 Path: /msf/auth/login – Powell Mittra Dec 08 '14 at 06:13
  • I believe that `Name` should be `X-Tr-Auth` and `Value` = `${authcode}` – Dmitri T Dec 09 '14 at 08:52