Selenium is an open source tool used for automating web application testing. It runs tests directly in browsers like Firefox, Chrome, Safari, and Internet Explorer. There are four main components of Selenium: Selenium IDE for recording and playing back tests in Firefox; Selenium Remote Control for running robust test suites across browsers and platforms; Selenium Core for running tests on the server hosting the application; and Selenium Grid for distributing tests across multiple machines. Selenium tests are created using commands to simulate user interactions and make assertions about the application's behavior and output.