Apr 22

When I first heard of WATIR, it was an eye opener for me. It kicked HttpUnit/JWebUnit’s ass. Why use something that pretends to be a browser while you can simply interact with a real browser, right? After I introduced Ted to Paul Rogers, we started using WATIR extensively in our project. We created hundreds or maybe even thousands of WATIR tests in just a few months. Everything seems to be going well.

But when we object-oriented developers meet a good OO language, we tend to create a thing called object hierarchy. The more object-oriented we are, the deeper the hierarchy we create. This is not a good thing when you are working with a language with close to zero IDE support. Ruby is one of those languages. It’s a nightmare to figure out whether a constant or method has been defined and where it is if it has. There is also a lot of duplications and therefore chances for error because we cannot reuse the Java code in Ruby. Not too many developers are willing to write and maintain them except those who have to.

Here is where Ruby’s impact on Java comes into play. We’ve already seen it in stuff like GWT, Groovy and Grails. Now there is Watij. My coworker Chris found out about it when he’s working on a side project. It’s pretty much a WATIR clone in Java. But it’s easier to use than WATIR because you can reference your Java code, write your tests as JUnit tests and run them in your favourite IDE. It’s also very easy to set up. I can’t post any screen shots here because Watij currently only support IE and I’m a Mac guy. So you have to give it a try yourself. I’m sure you won’t be disappointed.

preload preload preload