Discussions

News: RA TestHarness Released - New Open Source Testing Framework

  1. RA TestHarness supports Java class tests similar to those in JUnit and provides a unique approach to Web application testing. Web tests automate the testing of page interactions by parsing hidden test info embedded in the HTML generated by a JSP, or CGI mechanism. RA TestHarness can be used together with ANT and JUnit as part of a develop, test and deploy strategy.

    RA TestHarness is an open source product released under the LGPL licence and hosted on SourceForge.net.

    Check out the project home page at
    http://portal.remoteapps.com/ratestharness

    Some of the benefits of using RA TestHarness include:
    · Tests are very easy to write for your existing Web applications
    · Tests can also test the workflow of Web applications, as session state can be stored between tests
    · We believe standard class tests are easier to write than JUnit test cases

    Please feel free to reply to this article with your opinions and provide the community with your experience.

  2. http://www.httpunit.org/

    http://jakarta.apache.org/commons/latka/

    See also:

    http://jakarta.apache.org/cactus/

    http://www.tagunit.org/
  3. Thanks for your response. There are many other good and useful testing frameworks available. It is a matter of choosing the one that is right for you.

    We believe the way our testing mechanism works is unique. For example: HTTPUnit provides the developer with an API to ease the creation of JUnit test case classes for testing the content of a given URL. Though useful in some cases, this is very difficult when writing tests and the tests may run into 100s of lines.

    The strength of RA TestHarness comes from the simple and robust mechanism for testing Web based applications, without the need to use any API.

    It is also worth noting that you can still run JUnit tests when using the RA TestHarness

    Thanks once again and if you’d like to try out RA TestHarness I’d be interested in your experience.
  4. Sean

    Yes, there are other open source projects within the space of Web application testing.

    I always try to make use of other available technologies in my day to day development rather than waste time reinventing wheels. The links you have given all are useful but I found that they were not completely what I has looking for when I was testing web applications.

    The web testing mechanism we developed in RA TestHarness is different to all you have mentioned with the exception or 'Tag Unit' where we are similar in that you can use JSP to create the tests. Tag Unit is quite different if you took a look at both.

    I noticed that I could never get developers in my team to write tests without moans and blank looks (sorry guys). But I noticed that all of the them wrote small bits of JSP that contained print out values (much like you do with Stdout) and that these were primitive signs of testing. They did this because it was quick and effective. However, they (the tests and not the team) suffered from three problems.

    1. Tests were not being re-used.
    2. Tests all printed out actual values and the developer would match the excepted value in their minds.
    3. Tests couldn't be automated.

    So I produced a mechanism that solved the problems as so

    1. I formalised the process they liked doing so much and asked people to put structure to the tests and not simply discard them.
    2. I asked them to put actual value, expected value and more test details in the page.
    3. I specified a way to markup the test information and produced an Ant target to hit the URL, extract the test data and print the results on the command line.

    As a result we now had lots of tests, a way of writing web app tests without coding Java classes and something that actually works independently of the server side template language. So as long as you write tests that output HTML with the specified hidden markup you can choose any language like Perl, CFM, ASP (if you have to), TCL, a servlet and JSP.

    We developed this over a year ago and felt others might like it, so released it as open source. We are not really in any competition with the other open source projects out there and will only add features that cannot be found elsewhere.

    There are several other features that are useful but you will have to read the docs for info.

    Dan





  5. Similar open source projects...[ Go to top ]

    "Tag Unit is quite different if you took a look at both."

    That's right, although both projects use JSP to wrap up the actual tests rather than Java classes, TagUnit is primarily for testing custom tags and really centers around the fact thay they are reusable components.

    Again, it all comes down to what you want to test...

    Simon
  6. You may also want to checkout maxQ - http://www.bitmechanic.com/maxq I think.

    It's an innovative approach to web application testing, but one that doesn't require you to write any _classes_ at all.

    I had similar experiences - noone wants to write classes to test web apps, the HTML changes too often to be practical.

    maxq takes a different approach. When you set it up, it acts as a proxy between your browser and the web app, building httpunit tests for your interactions (ie login, test a few pages, logout). Then the whole session is written to a jython file which can be executed by JUnit / Ant whatever.

    What if your HTML changes radically? Just throw away the test for that part of the app - fire up maxq, surf around a few web pages - voila, you've written a new test.

    Very cool stuff.

    Cheers,
    Mike

    PS I am not affiliated with BitMechanic or maxq in any way, I'm just a new (satisfied) user!
  7. Just to add another few projects to the list of open source testing frameworks...

    There's also JellyUnit...

    http://jakarta.apache.org/commons/sandbox/jelly/jellyunit.html

    which integrates cleanly with both Latka.

    http://jakarta.apache.org/commons/latka/index.html

    and AntEater

    http://aft.sourceforge.net/

    James
  8. Good little Ant. What a pleasure Ant has become in my life. Add RA to Ant and you have a nice and simple way to add test scripts to your build script. Build-and-test-and-build-and-test. Nice.

    The APIs seem pretty well thought out too. I'm wondering if you considered enhancing JUnit instead of building RA?

    -Frank Cohen (www.pushtotest.com)
  9. Frank

    We didn't extend JUnit because the code we put together initially was focussed only on the web tests and we wanted to avoid having to write TestCase classes. RATH (the name we like to shorten RA TestHarness to) defines the web tests as URLs written as a line in the Ant build file.

    <webTest url="http://> /tests/myfirstwebtest.jsp?someValue=1"/>

    I am not sure how much benefit there would be in making a JUnit TestCase to execute the web tests. We would have to produce a way to define the tests outside the class and be able to then configure the JUnit TestCase with the URLs.

    In reality RATH gains much more from Ant at the moment than it would do from JUnit. You can still write JUnit tests and define them in the same ant script.

    Ant definately is one of the most useful tools there is.

    Cheers

    Dan
  10. RATH. That's cool. Maybe you should consider WRATH = Web RATH. hehe

    Seems to me that having RATH as part of JUnit would be very good. There are lots of developers using JUnit and many books and support sites offering help with it. RATH inside JUnit would benefit as an open source project.

    I'm going to include RATH in my book: Testing Web Services which Osborne McGraw Hill will publish this fall. Details on the book are at http://www.pushtotest.com/ptt/thebook.html.

    -Frank