In this blogpost, we are going to learn about the heart of Selenium WebDriver, that is the commands we use to interact with the browser, the web page, and its elements.
WebDriver API comes with a rich set of commands, capable of handling different drivers, browsers and different types of elements on the web page.
WebDriver commands can be categorized into various categories.
- Browser commands
- Navigation commands
- findElement and findElements commands
- Browser window handling commands
- Multiple windows handling commands
- Alert/ Pop up commands
What is WebDriver ?
The answer is pretty simple, its a tool for automating a web application.
But programmatically, WebDriver is what?
So, the answer is WebDriver is an interface. And it extends SearchContext interface.
In this tutorial, we have categorized the methods/ commands defined in WebDriver interface based on its functionality and purpose.
Before moving on to commands, we will see how to create an instance of WebDriver.
WebDriver driver = new FirefoxDriver();
WebDriver chromeDriver = new ChromeDriver();
WebDriver internetExplorerDriver = new InternetExplorerDriver();
How to see all the commands of WebDriver interface at once?
To see all the commands of WebDriver, type firefoxDriver . (driver instance and DOT key).
You will get hints by Eclipse as below.
Visit the above mentioned links to get into details of each and every commands.
Hope it helps you !!