7
votes

Being a beginner in Jmeter, met with necessity to run a simple flow:

  • To log in web-app using webdriver sampler
  • To get & store cookies
  • To make GET/POST requests within the web-app (e.g. navigate to any inner page)

Test runs succeed for http://, but failed on HTTP-request step with 404 for https:// (two different sites)

What has been done to resolve:

1. Cookie Manager was added to Thread Group, placed prior Samplers

2. jmeter.properties changed to:

CookieManager.allow_variable_cookies=true
CookieManager.save.cookies=true
CookieManager.check.cookies=false

Thus, after changing save cookies to true, I expected to see all cookies saved in Debug Sampler > JmeterVariables, but I don't (either for http:// or for https://)

3. Regexp extractor (placed above HTTP sampler) used as:

Reference Name: COOKIE_EXT  
Regular expression: SSESSee2ec8d6b6eedd096cb782a386b4e5c3=(.*)
Template: $1$  
Match No.: 1  
Use empty default value

Put in GET request as:

name: cookie_ext  
value: ${COOKIE_EXT} 

As a result:

Response in Debug Sampler: COOKIE_EXT=  
Request data: GET ?cookie_ext=  
[no cookies]

4. Tried to find any additional Jmeter settings for https (e.g. TSL/SSL protocols). Seems there are no any required except specifying 'https' in HTTP sampler template. Played with Implementaion & Cookie Policy in HTTP Cookie Manager, but without effect.

What could be the reason?

(Jmeter 3.0, Google Chrome 51.0, Drupal 7.43)

1
Could you show your test plan ? - UBIK LOAD PACK
I think there is a problem with your regular expression. Are you sure the value "SSESSee2ec8d6b6eedd096cb782a386b4e5c3" does not change between users and iterations? - Kranthi Paidi

1 Answers

1
votes

I haven't seen any problems with handling cookies and HTTPS protocol so maybe you have misconfigured something.

HTTPS and Cookies

Remember a couple of things:

  • Any properties changes should be done in user.properties file
  • You need to restart JMeter to pick the properties up
  • Given you have CookieManager.save.cookies=true you are storing cookies into JMeter Variables already, there is no need to use regular expressions. Moreover, in case your regular expression is wrong (it seems very weird to me) you may overwrite "good" cookie from the HTTP Cookie Manager with "bad" value from the Regular Expression Extractor.

See Using the HTTP Cookie Manager in JMeter guide for more information on working with cookies in JMeter