Reference: http://www.newsqa.com/watir-vs-selenium/
Watir is essentially a ruby library that encapsulates the ie com interface.
Watir is a ruby library that wraps the COM interface to Internet Explorer. com is a long-standing Windows-based technology for making libraries accessible to various ages. this allows access to the Document Object Model (DOM) So it doesn't matter where on the page an object exists, what matters is how you identify it (ID, name, title, etc ).
Selenium drives browsers in a different way than watir. The automation engine of selenium is written in JavaScript and runs in browsers.
Selenium uses a unique mechanic for driving browsers. selenium's automation engine is written in JavaScript and runs inside a browser. the engine, called a browser bot, is embedded in a page that accesses the application under test in a separate frame. because of Cross-Site Scripting, selenium's browser bot has to be served from the same site as the application under test-requiring installation on the server.
Selenium supports the command language, called "selenese ".
Selenium supports a command language, called selenese. tests can be embedded in an HTML table, which will be read in by the browser BOT and then executed.
Both watir and selenium perform tests directly in the browser and can be run in the minimal state of the browser.
Both tools run tests directly in a browser, and both do it in a way that allows the browser to be minimized while the tests are running, which means you don't have to dedicate a machine to running tests.
Watir adopts the ruby language and is easy to learn. At first, watir only supports IE and now supports ff and safari.
Watir only supports ie. These variations of watir support other browsers.
- Firewatir-Supporting Firefox.
- Safariwatir-Supporting safari on the Mac.
Watir was designed to be easy to learn, it allows page elements to be identified by index, name, ID, value or adjacent text. complaint: watir is currently limited to IE browsers on Windows. there are efforts underway to support Firefox in the future.
Selenium was initially designed to support multiple browsers and platforms. Selenium must be installed on the server.
Selenium was designed for breadth of coverage-multiple browsers and platforms. It was expected to be used by the same developers who built the application. Complaint: Selenium requires a server-side installation.
Selenium supports multiple programming languages.
You can also express Selenium tests in a programming language, taking advantage of language-specific drivers that communicate in selenese to the browser bot.