views:

371

answers:

7

I've realized I need a full-fledged browser automation tool for testing user interactions with our JavaScript widget library. I was using qunit, starting with unit testing and then I unwisely started incorporating more and more functional tests. That was a bad idea: trying to simulate a lot of user actions with JavaScript. The timing issues have gotten out of control and have made the suite too brittle. Now I spend more time fixing the tests, then I do developing.

Is it possible to find a browser automation tool that works in: Windows XP: IE6,7,8, FF3 OSX: Safari, FF3 ?

  • I've looked into SeleniumIDE and RC, but there seems to be some IE8 problems.

  • I've also seen some things about Google's WebDriver, which confusingly seems to work with Selenium.

  • Our organziation has licenses for IBM's Rational Functional Tester, but I don' think that will work on the MAC.

The idea is to try to run tests on all the browsers our organization supports. Doable? Are my requirements unrealistic? Any recommendations as far as software to try?

Thanks!

+1  A: 

Selenium is probably your best bet out of the tools you mentioned. What are the issues it has with IE8? You might want to check out HttpUnit to see if that meets your needs, also.

Rob Heiser
I haven't actually used Selenium yet but saw some comments on various forums saying there were problems with IE8. This supported browser page indicates that it does not support IE8. http://tinyurl.com/cdzdk6. Any ways around this, or is this support page outdated?I've also read that the maintaner of Selenuim is pretty overloaded, and hasn't done much work on it. I realize it's open source and don't mind getting a recommendation for non-open source if something would meet my needs.
Aaron
I've updated the documentation to say that it supports IE8
AutomatedTester
We've used it in IE8 without any issues. Another tool you might want to take a look at is Watir/Watij.
Rob Heiser
AutomatedTester: Thanks for updating.
Aaron
Rob: I have a friend who likes WATIJ. Can't readily see from the docs, does it support OSX, SAFARI as well as Windows FF, IE?
Aaron
A: 

I'm in the same boat. It is a difficult problem to solve. Windmill and Selenium are the 2 best I've found. Though they both have issues. Selenium can only record scripts in Firefox and I haven't managed to get the proxy chaining to work as advertised. Windmill you can record in any browser and you can supposedly tweak the proxy to put extra logic in there, but the js mechanism for recording across page loads has been in my experience very brittle at least on the app I have to test.

I don't think anyone can get it quite right as long as there is more than one browser that needs to be supported.

Tom Willis
I think what I will do is try out a few test cases with Windmill and with Selenium. I will report back. Thanks for the input.
Aaron
"I don't think anyone can get it quite right as long as there is more than one browser that needs to be supported." Check out Sahi (http://sahi.co.in/). Seriously.
Narayan Raman
+3  A: 

I would recommend using Selenium but I say that as a Selenium Committer.

Selenium works on any browser that supports JavaScript since the framework has been written in JavaScript. This means if your browser on any OS supports JavaScript it will run in Selenium. That documentation it out of date, you can see that since it is talking about IE8b1 and IE9 preview is out now.

Selenium and WebDriver (which isn't a Google thing since it started at ThoughtWorks) are currently being merged as they both have their strengths and weaknesses. The current merged work will be called Selenium 2 and you can start using the alpha release now at http://code.google.com/p/selenium/. It will still work on any OS as that is still the main driving force behind the work being done.

Selenium IDE only works on Firefox because it is a Firefox add on.

I personally would avoid Rational Functional Tester because it has a lot of weaknesses that its not even worth contemplating.

If you start with Selenium there are some tutorials on my site at http://www.theautomatedtester.co.uk

AutomatedTester
A: 

Maybe have a look at SIKULI. It's a different paradigm but, depending on what you want to test exactly, it may do the job and will work with any browser, on any platform. Have a look at their official blog for some examples of interactions with web applications.

Pascal Thivent
+1  A: 

Selenium RC is a great tool if you invest the time to use it. With significant modifications to the existing library I've gotten it to fulfill all of my front end testing needs.

The confusion you are having about Webdriver is understandable. Selenium 2 is in development and will be a merge of Webdriver and Selenium. Check out: http://www.youtube.com/watch?v=RQD4EzWI4qk to get more detail.

The only browser that I have found to be unusable with Selenium is IE6. IE7 and IE8 work fine as does Firefox (which I have modified to include firebug for debugging purposes).

dhackner
So far I have been able to get it work with FF3 (WIN and MAC), and IE8. It took some messing with the Python to get my particular test to work with IE8, and it just so happens I am very familiar with browser-specific key events and how they work. I am waiting to try IE6.
Aaron
As a note, upgrading to FF3.5 seems to have broken the Java RC for me. I got 3.6 to work, but it wiped out my server upgrades (like installing jQuery).
dhackner
A: 

So I wrote some of my more problematic tests in Selenium RC, using the Python driver. It was a better experience than writing the same tests in pure JavaScript, but I still had some of the same issues.

Testing something like an ajax autocomplete widget, meant forking some of the code depending on IE, or Firefox, and I still can't get typeKeys or a combination of type with typeKeys to work in Safari.

So, I am not sure if having cross browser clean, extensive ui tests is a bit unrealistic.

Should I try webdriver/Selenium 2? Would that make things better, or is that product not ready for prime time yet? How's the Python binding for that? I don't know Java, but I would learn some if need be.

Aaron
A: 

Try Sahi (http://sahi.co.in/) It works across browsers and operating systems. It has a powerful recorder, and great APIs for object identification. It supports HTTPS, proxy tunneling etc. and has drivers in sahi script, java and ruby. It also has parallel playback inbuilt. It is 5 yr old mature project hosted on SourceForge, with releases almost every month.

It automatically waits for AJAX and page loads, and does not use XPaths for object identification. It also handles sites with dynamic ids.

Narayan Raman