</>

Technology

Selenium

Difficulty

Beginner

Interview Question

What are different forms of selenium?

Selenium comes in four forms - WebDriver, IDE, RC, and Grid - each serving a different purpose in test automation.

Answer

Selenium comes in four forms:

1. Selenium WebDriver
  • Most widely used component of Selenium
  • Automates web applications using the browser's native methods
  • Directly communicates with the browser without any intermediary
  • Supports Java, Python, C#, JavaScript and more
2. Selenium IDE
  • A browser extension available for Chrome and Firefox
  • Works on Record and Playback principle
  • Best suited for beginners and quick prototyping
  • Not recommended for large-scale automation projects
3. Selenium RC (Remote Control)
  • Officially deprecated by Selenium
  • Used JavaScript injection to automate web applications
  • Required a Selenium RC Server to be running
  • Replaced by the more powerful Selenium WebDriver
4. Selenium Grid
  • Allows Selenium tests to run in parallel
  • Tests can run across multiple machines and browsers simultaneously
  • Reduces overall test execution time significantly
  • Consists of a Hub and multiple Nodes

Real-World Example

A large banking application team uses:

  • Selenium WebDriver to write automation scripts in Java
  • Selenium Grid to run 500+ tests in parallel across Chrome, Firefox, and Edge simultaneously
  • Selenium IDE for quick smoke test recordings by manual testers

Code Example

Java
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class SeleniumForms {
    public static void main(String[] args) {

        // Selenium WebDriver - Chrome
        WebDriver chromeDriver = new ChromeDriver();
        chromeDriver.get("https://www.google.com");
        System.out.println("Chrome Title: " + chromeDriver.getTitle());
        chromeDriver.quit();

        // Selenium WebDriver - Firefox
        WebDriver firefoxDriver = new FirefoxDriver();
        firefoxDriver.get("https://www.google.com");
        System.out.println("Firefox Title: " + firefoxDriver.getTitle());
        firefoxDriver.quit();

        // Selenium Grid - Remote WebDriver example
        // DesiredCapabilities caps = new DesiredCapabilities();
        // caps.setBrowserName("chrome");
        // WebDriver remoteDriver = new RemoteWebDriver(
        //     new URL("http://hub:4444/wd/hub"), caps);
    }
}

Best Practices

  • Always prefer Selenium WebDriver for writing automation scripts
  • Use Selenium Grid when you need parallel execution across browsers
  • Avoid Selenium RC in new projects — it is officially deprecated
  • Combine WebDriver + Grid for maximum efficiency in CI/CD pipelines

Common Mistakes

  • Using Selenium IDE for production-level automation (it's only for quick prototyping)
  • Confusing Selenium RC with Selenium WebDriver (RC is deprecated — always use WebDriver)
  • Not knowing that Selenium Grid needs a Hub + Node setup to work

Follow AutomateQA