Question

Is there a better unit testing tool than WaTiR for Ruby web testing? Or is the defacto standard? What unit testing tools do you use?

Was it helpful?

Solution 4

I didn't feel that I could mark any 1 of these as an answer.

From what I see from the responses, is that WaTiR is one of the best if you're sticking with Ruby as the testing language.

I personally agree with Ryan Guest about Selenium due to the cross browser support and language-agnostic approach. On the other hand, it uses it's own language, so it's one more thing to learn.

Scott Hanselman has a podcast titled Functional Testing Tools Roundup that sort of talks about this question.

When it comes down to it, I think the answer is that WaTiR is a great testing tool if it fits your situation.

OTHER TIPS

We use it for all our web application testing, not just ruby based web applications. We did look into a number of products but felt that WaTiR was the best. Plus it is in Ruby so we can pat ourselves our backs and tell each other how cool we are for using Ruby.

After taking a long look at waitr, my team decided on Selenium.

Among the many reasons were:

  • The one that Steven mentioned, Selenium has better browser and cross-platform support. We currently have machines running mac, linux, and windows with safari, firefox, and ie.

  • Selenium tests seemed to run faster than waitr, especially if you take advantage of selenium grid.

  • Selenium tests could be written in a wider variety of languages than just Ruby.

  • Selenium has an easy to use IDE.

Used as web crawling tool. WaTiR is also great for testing as I have heard. Be aware that each browser has their own version of WaTir: WaTiR(IE), FireWaTir(Firefox) and SafariWatiR(Safari).

I have been using Watir since 2007 but more as a scripting tool than an unit testing tool.

As a manual tester, it is very useful for some repetitive tasks, but I never got around to actually use it "properly" (creating test cases to see what features are failing and whatnot).

Also, I have showed Watir to some friends of mine who are programmers and they are using it to help them during development of systems written in Java, PHP and even ASP, so just because Watir is a Ruby project, it doesn't mean you should use it only with other Ruby projects :)

I use Watir for Functional testing.

For Unit testing, if at all possible a 'headless browser' solution such as webrat or capybara is prefered IMHO as they are far faster and don't complicate things by needing to invoke an instance of the browser etc.

You want unit tests to be FAST, so they can run with every CI build. Then create an overnight build, and have it run your functional tests, that way if they take hours to run, it's no big deal. (and once you get a large suite of thousands of functional/acceptance/regression tests, it will take hours to run even with faster browser such as the new IE9, Firefox, or Chrome.

I should also note that with the new Watir-Webdrive project you can get what amounts to the best of both worlds. The easy to code, very 'Rubyesque' Watir API, and the broad browser support (IE, FF, Chrome, Opera, Headless) of the selenium Webdriver back-end.

Worth noting that the FireWatir project has been rolled into the Watir core and the codebases integrated as of the 1.6.2 release last week.

We had a look at WaTiR a few years ago and decided against it for various reasons, mostly around ease of use compared to the likes of selenium (as in writing code vs visual tools).

It's worth mentioning that the people who were doing the test-building where not developers let alone Ruby developers.

This also wasn't for ruby apps, but as it's the web and the web serves HTML it shouldn't matter what it's built with.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top