The main interface to use for testing, which represents an idealised web browser. The methods in this class fall into three categories:
- Control of the browser itself
- Selection of {@link WebElement}s
- Debugging aids
Key methods are {@link WebDriver#get(String)}, which is used to load a new web page, and the various methods similar to {@link WebDriver#findElement(By)}, which is used to find {@link WebElement}s.
Currently, you will need to instantiate implementations of this class directly. It is hoped that you write your tests against this interface so that you may "swap in" a more fully featured browser when there is a requirement for one. Given this approach to testing, it is best to start writing your tests using the {@link org.openqa.selenium.htmlunit.HtmlUnitDriver} implementation.
Note that all methods that use XPath to locate elements will throw a {@link RuntimeException} should there be an error thrown by the underlyingXPath engine.
@see org.openqa.selenium.ie.InternetExplorerDriver
@see org.openqa.selenium.htmlunit.HtmlUnitDriver