Watir works by using the OLE/COM Automation interface to control Internet Explorer and automate web tests. It drives the browser to perform actions and tests functionality by accessing and manipulating the Document Object Model (DOM) of web pages, which represents the structure and elements of pages. Tests are created by viewing the source of pages, using Watir methods in IRB, or with DOM inspection tools to understand the DOM structure that the tests will interact with and verify.