JMeter Non HTTP response message: Unconnected sockets not implemented

If you’re testing HTTPS with JMeter 2.3.2 and a current version of Java greater than 1.5 e.g.

java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

Then you are likely to encounter this error when using the standard HTTP Request sampler:

Response code: Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Unconnected sockets not implemented

If you have the opportunity, use the HTTP Request HTTPClient sampler instead and this problem should be resolved. Otherwise use Java 1.5 instead. If you’ve already recorded your test plan in JMeter or other tools (like BadBoy) then some simple regular expressions on the jmx file will fix the problem manually.

Windows:

ruby -pi.bak -e "gsub(/

ruby -pi.bak -e "gsub(/HTTPSampler>/, 'HTTPSampler2>')" *.jmx

Mac:

ruby -pi.bak -e "gsub(/

ruby -pi.bak -e "gsub(/HTTPSampler>/, 'HTTPSampler2>')" *.jmx

Read More

Performance Testing MQ with JMeter

This is a relatively new example of how to use JMeter with WebSphere MQ. This approach is a clever way of inserting messages into MQ using a JMS sampler (point to point) with a JNDI binding within MQ.

I had not heard of this approach before and am sure it will be useful in future, provided you have sufficient access to create the bindings in the first place.

Read More

Why do I get an "Error 501/505 – Not implemented or not supported" in JMeter?

This is most likely because the JMeter recording proxy does not support the https protocol. If it’s a screen you can live without, you can just stop/start the proxy recorder around that page (I use the Firefox plugin called FoxyProxy to quickly switch between different proxy configurations).

However, if it is vital to your script (for example, a login page) then you can use an alternative recording tool called Badboy Software. I frequently use this to record HTTPS then export the test plan to JMeter. Alternatively you can manually create the HTTPS request sample yourself.

JMeter can run HTTPS request samplers, it just can’t record them using the native proxy recorder.

Read More

JMeter Tips and Tricks – Correlating with Regular Expressions

Another post in this current theme of JMeter tips and tricks… You will hear LoadRunner consultants preaching to the converted about the requirement to correlate data accurately. What they’re referring to, is making sure that dynamic data received by the client from the server (typically in a response body, header or url), which changes from request to request, is accurately correlated. If you don’t, you will probably ‘break’ the application logic with most obvious signs during replay being things like HTTP Server 500 errors.

In practice, correlation requirements relate to things like session ids, viewstate, cookies, date time stamps and other transactional information. So more often than not you will see this data changing following a post back or response from the server. With the introduction of AJAX calls, correlation requirements probably increase (per page) as the number of transactional requests probably increases as well.

In LoadRunner, you typically correlate data manually using the web_reg_save_param function. This in effect is a prepared statement, placed before the request that will return the data in the response you are looking for. For example, your function will specify a left and right boundary of the data that it is looking for before you make the request. Then the request is made and if a match is found, then the data is saved in a parameter which you can later call as a variable in subsequent requests. LoadRunner also has a feature called Correlation Studio which takes affect during recording of your script, using a similar approach (left and right boundaries) and then dynamically swapping corresponding matches with the variabilzed data. All this is quite painful though, and whenever I’m specifying primitive left and right boundaries or using the flaky Correlation Studio (I can explain if you like), I’m left wishing I could just use regular expressions …

The trick to correlating data easily with JMeter is to first know what data it is that needs correlating! (duh…) Experience will make this easier as a lot of common web apps have common dynamic data requirements as already mentioned. Another trick is to always record the script twice (and diff to see differences between unique user sessions), then more often than not record 2+ iterations of an action within a single script (and diff to see differences between user transactions/actions). If you do this before anything else, and diff the results, you will save bucketloads of heartache in getting your script harnesses running, no matter which tool you choose.

But back to JMeter, once you do know what data you need to correlate, simply create a Post Processor -> Regular Expression Extractor to ‘variablize’ that data. Huh? Read on for a more detailed explanation of this.

Read More

JMeter Tips and Tricks – Better (More Pretty) Graphs

This plugin has been around for a while and it’s definitely worth including in your JMeter library if you want to go for a glossy finish! The StatAggVisualizer will transform your graphs
from thisold_graph.png to thisnew_graph.png

If you roll-up your transactions into separate transaction controllers as I demonstrated in a previous post, you will get useful summary views for all your transactions:
transaction_summary.png

Alternatively, drop a stat agg visualizer listener under a single controller to get a graph for a single transaction, useful if clients are only interested in certain transactions.
stat_add_individual.png

Read More