Overview of WebDriver commands

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.

  1. Browser commands
  2. Navigation commands
  3. findElement and findElements commands
  4. Browser window handling commands
  5. Multiple windows handling commands
  6. 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();

OR

WebDriver chromeDriver = new ChromeDriver();

OR

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.

WebDriverCommands

WebDriverCommands2

Visit the above mentioned links to get into details of each and every commands.

Hope it helps you !!

Cheers 🙂

Advertisements

#remote-webdriver, #types-of-webdriver-commands, #webdriver-commands