Read the value of a cookie in Jmeter

Just found that there is one property of Jmeter that I can set so as to get the value of a cookie.


The following is from Jmeter site (http://jmeter.apache.org/usermanual):


"Received Cookies can be stored as JMeter thread variables(versions of JMeter after 2.3.2 no longer do this by default).To save cookies as variables, define the property "CookieManager.save.cookies=true".Also, cookies names are prefixed with "COOKIE_" before they are stored (this avoids accidental corruption of local variables)To revert to the original behaviour, define the property "CookieManager.name.prefix= " (one or more spaces).If enabled, the value of a cookie with the name TEST can be referred to as ${COOKIE_TEST}."


The problem that I got is where to set this property: CookieManager.save.cookies=true.


In a rush, I googled and found that there is a property file under the Jmeter install directory: jmeter.properties, where I can set that boolean value as above. In order to save time, I just update this file. Actually I can override these properties via the command Line:


The following is also from Jmeter site (http://jmeter.apache.org/usermanual):

Java system properties, JMeter properties, and logging properties can be overriden directly on the command line (instead of modifying jmeter.properties).To do so, use the following options:

-D[prop_name]=[value] - defines a java system property value.

-J[prop name]=[value] - defines a local JMeter property.

-G[prop name]=[value] - defines a JMeter property to be sent to all remote servers.

-G[propertyfile] - defines a file containing JMeter properties to be sent to all remote servers.

-L[category]=[priority] - overrides a logging setting, setting a particular category to the given priority level.

The -L flag can also be used without the category name to set the root logging level.

Examples:

jmeter -Duser.dir=/home/mstover/jmeter_stuff \
    -Jremote_hosts=127.0.0.1 -Ljmeter.engine=DEBUG

jmeter -LDEBUG

N.B.
The command line properties are processed early in startup, but after the logging system has been set up.Attempts to use the -J flag to update log_level or log_file properties will have no effect.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值