Tag Archives: Jmeter

Measuring the response bytes using jmeter

If you want/need to measure the response bytes size from the jmeter results and analyze/get the trends. Following will help

Make sure you disable the flag “Keep-alive” in your HTTP request. (Found that enabling this can skew the payload size that jmeter reports. In a thread, if the request is made multiple times jmeter tool provides the cumulative payload size instead of the individual request response bytes. )

If you create CDF for this bytes data, the graph is a straight line with very high payload data which is ever increasing. Unless you need the keep-alive for your request, disable it in your http request.


Leave a comment

Filed under JMeter

How to Assert on HTTP Response Code in Jmeter

While testing performance of web applications we would want to verify the pages are functioning as expected. But sometimes the page is too huge for the jmeter test client to download, or some times you are not concerned about the contents of the response page, rather you just want to make sure the page is delivered, i.e. there are no 404 or 500’s , but the response code is 200 OK, or redirect 302 , which ever is expected in your test scenario.

solution :

In the Response Assertion you should select “Response Code” rather than the default response, and add 200|302 if you are expecting redirect or 200 if you want to test if the page is being delivered without at issues.

1 Comment

Filed under JMeter

Functions in Jmeter Bean Shell

Type of function Name Comment
Information threadNum get thread number
Information machineName get the local machine name
Information time return current time in various formats
Information log log (or display) a message (and return the value)
Information logn log (or display) a message (empty return value)
Input StringFromFile read a line from a file
Input CSVRead read from CSV delimited file
Input XPath Use an XPath expression to read from a file
Calculation counter generate an incrementing number
Calculation intSum add int numbers
Calculation longSum add long numbers
Calculation Random generate a random number
Scripting BeanShell run a BeanShell script
Scripting javaScript process JavaScript (Mozilla Rhino)
Scripting jexl evaluate a Commons Jexl expression
Properties property read a property
Properties P read a property (shorthand method)
Properties setProperty set a JMeter property
Variables split Split a string into variables
Variables V evaluate a variable name
Variables eval evaluate a variable expression
Variables evalVar evaluate an expression stored in a variable
String regexFunction parse previous response using a regular expression
String char generate Unicode char values from a list of numbers
String unescape Process strings containing Java escapes (e.g. \n & \t)
String unescapeHtml Decode HTML-encoded strings
String escapeHtml Encode strings using HTML encoding

Reference / details – http://jakarta.apache.org/jmeter/usermanual/functions.html


Filed under J-testing, JMeter

JavaRequest in JMeter

click here for a cool tutorial on building JavaRequest component in Jmeter –

Leave a comment

Filed under J-testing, JMeter