Web/HTTP Testing

Hello,

I am looking for a user test automation tool. When I say ‘user’, I
mean it should mimic the user interacting with the app. That
ultimately boils down to a tool that drives a browser or is able to
make http requests and allow us to deal easily with the responses.

Our requirements are to be able to write the tests in Ruby (no need to
switch to other language for test designing) and (relative)
browser-independence (this one puts Watir out of the game, since it
seems to be IE-dependent for the time being). A nice feature (but not
a must-have) would be possibility of headless (command line)
execution.

I am aware of Selenium and WebUnit. Does anyone have any experience
with either one (or a similar tool)?

Cheers,

Thiago A.

I feel Selenium is the way to go. You have a couple of options:

There is the selenium_on_rails plugin:

Lets lets you write the normal, table-based tests using a form of
Markdown, called Selenese, or in Ruby using RSelenese.

There is also:

http://blog.viney.net.nz/articles/2006/02/09/selenium-testing

This uses the normal Ruby Test::Unit infrastructure for writing tests
and loading fixtures.

I had a few problems with the second one, so I use the
selenium_on_rails plugin and it works great.

You can install selenium itself using RubyGems but its an old version,
or download the latest version of Selenium (0.6) and extract into your
vendor directory. Follow the instructions for either of the above.

On 2/23/06, Thiago A. [email protected] wrote:

seems to be IE-dependent for the time being). A nice feature (but not
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Cheers,
Luke R.

Thiago A. wrote:

I am aware of Selenium and WebUnit. Does anyone have any experience
with either one (or a similar tool)?

Yes, I’ve used (and still using) Watir quite extensively for just the
kind of work you describe. It’s the best thing since the sliced bread,
as long as you don’t have to deal with applets, and can live with your
automated tests working on IE 5.5+ only.

I haven’t worked with Selenium, but some fellow ThoughtWorkers say it’s
a Good Thing ™, too. The tradeoff, as far as I understand, is that
with Selenium you have to have some stuff installed on the web server
(deployment is more complicated, therefore), but you can use it on any
OS, with a variety of browsers.

Alexey V.

I’ll probably sound like a moron here, so bear with me :slight_smile: I don’t
understand the interest in these kinds of tools.

Seems to me that decent functional tests are will make sure your actions
are doing what you want them to do.

This is not the first thread I’ve read that mention the value of
Selenium and Watir, so obviously I’m missing something. Any
enlightenment would be appreciated.

Thanks!
Jeff

Jeff C. wrote:

Seems to me that decent functional tests are will make sure your actions
are doing what you want them to do.

Yes, but… When you say “functional”, you obviously refer to Rails
controller tests. Well, not everybody (to put it mildly) develops on
Rails. :slight_smile:

And even with Rails, from a developer’s point of view, controller tests
do not cover at least two big things:

  1. Javascript.
  2. URL parsing/generation

Also, coverage of HTML produced is in practice either non-existant or
patchy (hoe many people actually use XPath assertions against
@response.body?)

Watir is great for testing end-to-end scenarios, where you click through
several screens and there are no 404s or 500s. The #1 reason for adding
Watir test battery to Instiki was that I’ve had some some fairly heinous
bugs around URL generation, escaping my unit/controller tests.

Ability to do test automation for AJAX should be useful, too.
Disclaimer: I did not personally try testing AJAX calls with Watir on
any industrial scale yet, but I spiked it once and it works.

Best regards,
Alexey V.

Thats because Rails’ idea of “functional” tests aren’t really
functional tests, they are more like unit tests for your controllers.
They are great for making sure an action does what it needs to do but
its not very good for testing your app as a whole and making sure your
app is doing what it should, not just the code.

This is where acceptance testing tools like Selenium come in.

Not just that, but clients should be able to write acceptance tests,
not just programmers, as it is your clients who should define what the
acceptance tests are.

Finally, unless you’ve tested your browser-based app inside a browser,
you haven’t really done any proper acceptance testing. Selenium and
Watir let you do that, and they let you automate the process too.

On 25 Feb 2006 04:22:44 -0000, Jeff C.
[email protected] wrote:

Thanks!
Jeff


Posted with http://DevLists.com. Sign up and save your time!


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Cheers,
Luke R.