Show and Tell Thursday - Rational Test Manager "rtpar" decoder

Joining in the spirit of Rocky's Show and Tell Thursday idea, I thought I'd share a tool which I wrote last year. The reason I haven't posted it before is that it's got a fairly niche market and it's just re-using techniques which are pretty familiar now (AJAX to get some XML and then XPath and DOM processing to output some HTML). However it's been pretty useful for me and I don't have a huge amount of time to write anything new at the moment so you never know.

So what is it? Well, if you use Rational Test Manager for writing your test scripts you may know that getting at the scripts themselves can be quite hard work and pretty much impossible unless you have the Test Manager software installed. A part of our release procedure is that we provide the System Test scripts to the business users to check over to make sure that they reflect "real" usage of the system. So they don't have access to Rational and they wouldn't make much use of the other features anyway, all we want is a listing of the steps in each script. To get this out manually into text files takes ages. However, there is an export feature which will give you an "rtpar" file which contains all of the scripts within a project. Now if you look at contents of the rtpar file you'll find that it's just XML so where we are going next is pretty obvious...

I put together a (very) quick NSF which has two forms. One allows you to upload the XML file (with a standard Domino server you just need to change the rtpar file extension to xml so that Domino knows what it's serving out), the other looks at the file you uploaded and formats it into HTML so that you can print it out or do whatever else you like with it.

You can see a demo of the app here.

Now, the obvious first comment is... Why aren't you using XSLT to produce this? Well there's no reason I couldn't, but I needed it quickly and frankly I know the AJAX stuff better than XSLT. So just get off my back man :-)

The code itself is pretty simple, all it does is work out the URL to load the XML file using the ubiquitous XMLHTTPRequest. Once the XML is loaded it's really a matter of just looping through each test folder and within those each test script and outputting the contents into a table format.

The sample I have pointed to above is very small, just a single script, but we have used this tool to produce a PDF for our users which amounts to several hundred pages of scripts. Although it takes a while for the XML to load (about 30 seconds or so) it still has no problem in parsing it and displaying it.

In conjunction with the CutePDF printer tool it has saved my testers and me hours of work for every release we do. So I hope it's of use to someone out there.

Download the NSF here