Introduction to Selenium
1. What is Selenium?
Selenium is an open-source tool that automates web browsers.
It provides a single interface that lets you write test scripts in various programming languages such as Java,
Python, C#, etc.
2. Selenium Components
Selenium has four major components:
1. Selenium WebDriver - Automates browsers by directly communicating with them.
2. Selenium IDE - A Chrome and Firefox extension that allows record-and-playback of interactions.
3. Selenium Grid - Allows parallel execution of tests across different browsers and machines.
4. Selenium RC (deprecated) - An older tool used before WebDriver.
3. Basic WebDriver Script (Python Example)
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.example.com")
print(driver.title)
driver.quit()
4. Advantages of Selenium
- Open-source and free
- Supports multiple browsers and platforms
Introduction to Selenium
- Integrates with frameworks like TestNG, JUnit, and Pytest
- Supports parallel and distributed testing