Cookie Manager Query from JMeter 3.3 onwards

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cookie Manager Query from JMeter 3.3 onwards

Steven Allison
Hi,

Recently I upgraded from Apache JMeter 2.13 to JMeter 3.3 and have encountered some difficulties with the Cookie Manager, which I wanted to ask about.

For a scenario that worked fine in v2.13 when I switched to v3.3, I noticed that I was receiving errors in the error log of the following ilk:

************************************************************************************************
ERROR o.a.j.p.h.c.HC4CookieHandler: Unable to add the cookie
org.apache.http.cookie.MalformedCookieException: Blank or null value for domain attribute
                at org.apache.http.impl.cookie.BasicDomainHandler.parse(BasicDomainHandler.java:60) ~[httpclient-4.5.5.jar:4.5.5]
                at org.apache.http.impl.cookie.RFC6265CookieSpec.parse(RFC6265CookieSpec.java:181) ~[httpclient-4.5.5.jar:4.5.5]
                at org.apache.jmeter.protocol.http.control.HC4CookieHandler.addCookieFromHeader(HC4CookieHandler.java:125) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.protocol.http.control.CookieManager.addCookieFromHeader(CookieManager.java:361) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.saveConnectionCookies(HTTPHC4Impl.java:1583) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:528) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178) [ApacheJMeter_http.jar:4.0 r1823414]
                at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490) [ApacheJMeter_core.jar:4.0 r1823414]
                at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416) [ApacheJMeter_core.jar:4.0 r1823414]
                at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250) [ApacheJMeter_core.jar:4.0 r1823414]
                at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
***************************************************************************************************

The scenario runs to completion and is stepping through appropriately but each time an HTTP request is made, another error is added to the log.

Research revealed that others have encountered this, with the suggestion of changing "CookieManager.check.cookies=false" in the jmeter.properties file. The error still persisted however.  Another suggestion was to change the implementation in the Cookie manager but this is not an option in newer versions of JMeter (available in 2.13 but not 3.3 or 4.0).  Coincidentally when I changed the implementation in JMeter 2.13 from "HC3CookieHandler" to "HC4CookieHandler" I got the same errors in there too.

It might be worth noting that this only occurs with tests for a specific project.  Other projects moved from JMeter 2.13 to JMeter 3.3 seamlessly.  The concern is that for larger tests at higher volumes, although the scenarios work, the JMeter log fills up with these error messages for every single hit.  I am wondering if there is a way around this and why it only seems to occur in most recent versions of JMeter?

Finally the cookie that is being returned is along the lines of the following.

".ASPXAUTH={token}; path=/; expires=Sun, 18-Feb-2018 12:32:10 GMT; domain="

Regards

Steven
Reply | Threaded
Open this post in threaded view
|

Re: Cookie Manager Query from JMeter 3.3 onwards

Felix Schumacher
Am 14.02.2018 um 14:49 schrieb Steven Allison:
> Hi,
>
> Recently I upgraded from Apache JMeter 2.13 to JMeter 3.3 and have encountered some difficulties with the Cookie Manager, which I wanted to ask about.
>
> For a scenario that worked fine in v2.13 when I switched to v3.3, I noticed that I was receiving errors in the error log of the following ilk:
>
> ************************************************************************************************
> ERROR o.a.j.p.h.c.HC4CookieHandler: Unable to add the cookie
> org.apache.http.cookie.MalformedCookieException: Blank or null value for domain attribute

This message wants to tell you, that the cookie value is invalid (from a
standards point of view). If you don't want to fix or are not able to
fix the application setting the value, you can change the "Cookie
policy" from "standard" to something less strict like "default".

More information about the modes can be found at
https://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html#d5e515 
which can be reached from our documentation at
http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager

Regards,
 ¬†Felix

>                  at org.apache.http.impl.cookie.BasicDomainHandler.parse(BasicDomainHandler.java:60) ~[httpclient-4.5.5.jar:4.5.5]
>                  at org.apache.http.impl.cookie.RFC6265CookieSpec.parse(RFC6265CookieSpec.java:181) ~[httpclient-4.5.5.jar:4.5.5]
>                  at org.apache.jmeter.protocol.http.control.HC4CookieHandler.addCookieFromHeader(HC4CookieHandler.java:125) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.protocol.http.control.CookieManager.addCookieFromHeader(CookieManager.java:361) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.saveConnectionCookies(HTTPHC4Impl.java:1583) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:528) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178) [ApacheJMeter_http.jar:4.0 r1823414]
>                  at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490) [ApacheJMeter_core.jar:4.0 r1823414]
>                  at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416) [ApacheJMeter_core.jar:4.0 r1823414]
>                  at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250) [ApacheJMeter_core.jar:4.0 r1823414]
>                  at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
> ***************************************************************************************************
>
> The scenario runs to completion and is stepping through appropriately but each time an HTTP request is made, another error is added to the log.
>
> Research revealed that others have encountered this, with the suggestion of changing "CookieManager.check.cookies=false" in the jmeter.properties file. The error still persisted however.  Another suggestion was to change the implementation in the Cookie manager but this is not an option in newer versions of JMeter (available in 2.13 but not 3.3 or 4.0).  Coincidentally when I changed the implementation in JMeter 2.13 from "HC3CookieHandler" to "HC4CookieHandler" I got the same errors in there too.
>
> It might be worth noting that this only occurs with tests for a specific project.  Other projects moved from JMeter 2.13 to JMeter 3.3 seamlessly.  The concern is that for larger tests at higher volumes, although the scenarios work, the JMeter log fills up with these error messages for every single hit.  I am wondering if there is a way around this and why it only seems to occur in most recent versions of JMeter?
>
> Finally the cookie that is being returned is along the lines of the following.
>
> ".ASPXAUTH={token}; path=/; expires=Sun, 18-Feb-2018 12:32:10 GMT; domain="
>
> Regards
>
> Steven
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Cookie Manager Query from JMeter 3.3 onwards

glinius@live.com
In reply to this post by Steven Allison
You can try adding the next line to /user.properties/ file (lives in "bin"
folder of your JMeter installation)


> CookieManager.check.cookies=false

JMeter restart will be required to pick the property up.

More information:

JMeter Properties Reference: Miscellaneous configuration
<http://jmeter.apache.org/usermanual/properties_reference.html#miscellaneous>  

HTTP Cookie Manager Advanced Usage - A Guide
<https://www.blazemeter.com/blog/http-cookie-manager-advanced-usage-a-guide>  



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]