At my last position at Nokia, the majority of functional test cases I wrote to test web services and APIs were written using SoapUI. Pretty much anything I needed to do with my tests was included in the Pro version of SoapUI right out of the box. Of course, that version came with a price tag (US $350). Since leaving Nokia and joining Where the types of test cases I’ve need to create hasn’t changed much. Unfortunately the tool used to create these tests has. I’ve moved to a Jmeter shop.
One of the things I’ve always found interesting was tracking the trends in terms of technologies used in the industry. It seems as if when I first stared with web service and API testing SoapUI wasn’t nearly as widely used as it is today. Granted Jmeter at the time as well as today still seems to be the front runner. Many of the features are similar, but there is no free vs Pro version with Jmeter – only one package, and it’s free. Maybe that’s why a higher percentage of users are using Jmeter as opposed to SoapUI.
Before I get into listing the pain-points I’ve had in my migration from SoapUI to Jmeter I want to add one caveat…I understand that Jmeter was created more with load/performance/stress testing in mind, and functional testing is just something you can sort of derive from Jmeter’s built in features. My experience with both tools has been mainly focused on functional testing, and anything outside of functional testing is just a bonus I’ve been able to piggyback on from the tool.
Alright – let’s get to it. Here are a few things I really don’t enjoy about Jmeter, and why I was spoiled with SoapUI.
Property Transfers
SoapUI offers a great feature in both the free and Pro versions, property transfers. Property transfers allow you to easily take a response from your web service or API, key off a returned value, and pass that value along to either a future test step or a variable. Being able to easily look at a response, highlight the portion you want to save, and transfer that data can save you major time in developing test cases.
Jmeter doesn’t have the concept built in of a property transfer. Instead, you can use Post Processors to extract values (depending on the return type). While the Post Processors in most cases will get you where you need to be, there are some cases where you can’t easily get the data out of a response. There is also a flaw in the logic around how these are executed that I’ll cover in a bit.
Support for JSON Parsing
Both SoapUI and Jmeter don’t explicitly support parsing of JSON responses. SoapUI will however attempt to convert JSON to XML which can then be used for script assertions/transfers/etc. It’s not the best solution, but it works. Jmeter however has no support for JSON parsing. If you are returned JSON you’re going to have to either create a custom sampler to parse the data returned, or use a BSF assertion/post processor and extract data into variables by writing JavaScript. This isn’t a show-stopper, but it slows down the amount of time it takes to create test cases.
Test Plans/Test Cases
In SoapUI users are allowed to create multiple test plans within a project view. Each test plan can consist of many test cases, each with their own steps. This is makes everything wrap up into a pretty package and helps with origination of test cases. Jmeter on the other hand has only a concept of a test plan. Each test plan is essentially a single test case, although you can get somewhat around this by creating generic test plans that are data driven and loop through some external file that contains specific values for tests to key off of. Again – this isn’t ideal and makes debugging complicated tests a bit of a hassle.
Step Execution
WYSIWYG with SoapUI. If you want to put assertions 1/2 way through your test case go right ahead. SoapUI will read the test case top to bottom and execute in order. You never have to worry about your test case executing out of the order you created it in. In Jmeter, steps are executed in the following order (first to last): Configuration/Pre-Process/Timers/Sampler/Post-Process/Assertion/Listeners. This does make sense, but is a flawed approach. The problem with this is that certain attributes and functions are exposed only to specific step types in Jmeter. If you’re at the point where you want to use a Post-Processor, but you’ve already added an Assertion for a Sampler you’re screwed.
Reporting
With the click of a checkbox SoapUI can generate jUnit style reports in many different formats. No customization needed, and only relevant data types/columns will be used in the report generated. Jmeter however requires you to take a .xsl file and pass your output xml file through it to generate a HTML report. This report will always report the same headings and columns of data, even when that data isn’t available. On the up-side, xsl gives you more customization on your reports if you have the time to play around and create a custom xsl for your project.
In summary, SoapUI and Jmeter are very similar. In fact, you might argue that SoapUI is basically Jmeter with a few bells and whistles and some lipstick painted on. No matter how you look at it though, for functional testing SoapUI will get you implementing test cases with high readability quicker than Jmeter.
