1

I am trying to performance test an app that uses some high level security protocols (like Kerberos to name one)

I already correlated the tokens sent back and forth, but now run into an issue with the cookies.

In the request following a previous response, the app when used by a user in a browser, passes a cookie + a chunk of token from the previous response.

I already enabled cookies as variables in the user.properties file of JMeter.

JMeter's cookie manager does not handle this well so I need to proceed with a manual cookie handling and add the chunk of token to the end of it somehow.

But I am unsure how to achieve this and can't seem to find how to go about this online either.

Ceesiebird
  • 173
  • 2
  • 4
  • 10

1 Answers1

1
  1. Add JSR223 PreProcessor as a child to your request.

  2. Add this code:

    import org.apache.jmeter.protocol.http.control.Cookie;

    Cookie myCookie = new Cookie("chunkToken", "value", "domain", "path", true, Long.MAX_VALUE);
    sampler.getCookieManager().add(myCookie);

  • Will this work even if I keep my Cookie Manager active? And can I supply variables taken from the previous response like: `import org.apache.jmeter.protocol.http.control.Cookie;` `Cookie myCookie = new Cookie("${chunkToken}", "${value}", "domain", "path", true, Long.MAX_VALUE); sampler.getCookieManager().add(myCookie);` – Ceesiebird Feb 18 '19 at 09:23
  • Sure, it will work with Cookie Manager. – Vadim Yangunaev Feb 18 '19 at 10:38
  • Use vars.get("VARIABLE_NAME") to get variable value in JSR223 Sampler – Vadim Yangunaev Feb 18 '19 at 10:44