2009/9/17 Schif Schaf <schifsc...@gmail.com>: > What's the difference between WebDriver and Selenium?
Selenium runs in a browser, and uses JavaScript to perform all your automated actions. It need a browser running to work. Several are supported, Firefox, Safari, IE and I think others. You are at thier mercy of the browser's JavaScript engine - I've often had trouble with IE's XPath support, for instance - tests will run fine in Firefox and safari, but not work in IE. One big advantage of Selenium is that there an "IDE" available, a Firefox add-on which will allow you to record actions. This is useful for building regression tests and acceptance tests for bugs. Sadly, it often tempts people into writing their acceptance tests after the fact, too - a grave mistake IMHO. Selenium tests can be written in Python, Ruby, Java, and in the form of HTML tables. This last seems quite popular with QAs for some reason which escapes me entirely. WebDriver runs outside a browser. It can be (and usually is) used to drive a real browser, though there's is a HtmlUnit driver available, which bypasses any real browser and goes direct to the site you are testing. Even this last option, though, does allow the testing of sites which make use of JavaScript - which is just about all of them these days. It makes use of native drivers for each of the browsers it supports, so it runs very much faster than Selenium. Since it presents the test program with its own version of the page's DOM tree, it's also less likely to give browser incompatibilities. WebDriver tests can be written in Java or Python, at the moment. The Selenium people have recognized the superiority of the WebDriver approach, so the nascent Selenium 2 will use WebDriver under the covers. For the moment, though, you have to pick one or the other. Mechanize is a superb library for its intended purpose - I use it all the time. It's lack of support for pages with JavaScript functionality, though, means it's not very useful at a testing tool for modern web sites. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list