Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/saadsalmanakram/selenium-speedrun

Everything you need to know about Selenium...
https://github.com/saadsalmanakram/selenium-speedrun

selenium selenium-grid selenium-java selenium-python selenium-webdriver

Last synced: 9 days ago
JSON representation

Everything you need to know about Selenium...

Awesome Lists containing this project

README

        

---

# Selenium Speedrun πŸš€

![Selenium](https://upload.wikimedia.org/wikipedia/commons/d/d5/Selenium_Logo.png)

## πŸ“ Introduction

**Selenium-Speedrun** is a hands-on guide to mastering **Selenium**, an open-source automation framework used for web testing. This repository provides a structured, fast-paced learning experience covering **browser automation, web scraping, and UI testing** with Python.

Whether you're a beginner or an experienced tester, this speedrun will equip you with essential Selenium concepts, best practices, and real-world examples.

## πŸš€ Features

- **Quick Start:** Get up and running with Selenium in minutes.
- **Web Automation:** Learn how to interact with web pages dynamically.
- **Testing Frameworks:** Integrate Selenium with **pytest** and **unittest**.
- **Headless Browsing:** Run tests in the background without a UI.
- **Web Scraping:** Extract and process web data efficiently.
- **Explicit & Implicit Waits:** Master synchronization techniques.
- **Handling Forms & Popups:** Automate user inputs and alerts.
- **Cross-Browser Testing:** Work with Chrome, Firefox, Edge, and more.
- **Page Object Model (POM):** Implement scalable automation frameworks.

---

## πŸ“Œ Prerequisites

Before you start, ensure you have the following installed:

- Python 3.x [Download Here](https://www.python.org/downloads/)
- Google Chrome / Firefox / Edge
- ChromeDriver / GeckoDriver / EdgeDriver
- Selenium (`pip install selenium`)

---

## πŸ“‚ Project Structure

```
Selenium-Speedrun/
│── examples/ # Practical Selenium scripts
│── tests/ # UI automation test cases
│── resources/ # Sample web pages for testing
│── requirements.txt # Python dependencies
│── README.md # Project documentation
└── setup.py # Setup instructions
```

---

## ⚑ Quick Start

### 1️⃣ Clone the Repository
```bash
git clone https://github.com/saadsalmanakram/Selenium-Speedrun.git
cd Selenium-Speedrun
```

### 2️⃣ Install Dependencies
```bash
pip install -r requirements.txt
```

### 3️⃣ Run a Sample Script
```bash
python examples/first_script.py
```

---

## πŸ› οΈ Example: Automating Google Search

Here’s a simple script that opens Google, searches for "Selenium Python," and prints the first result:

```python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# Initialize WebDriver
driver = webdriver.Chrome()

# Open Google
driver.get("https://www.google.com")

# Find search bar and input query
search_box = driver.find_element("name", "q")
search_box.send_keys("Selenium Python")
search_box.send_keys(Keys.RETURN)

# Print first result
first_result = driver.find_element("xpath", "(//h3)[1]").text
print("First Result:", first_result)

# Close browser
driver.quit()
```

---

## βœ… Topics Covered

1. **Setting Up Selenium** (ChromeDriver, GeckoDriver, EdgeDriver)
2. **Locators** (XPath, CSS Selectors, ID, Class, Name, Link Text)
3. **Interacting with Web Elements** (click, send_keys, get_text)
4. **Handling Alerts, Popups, and IFrames**
5. **Waits and Synchronization** (Implicit, Explicit, Fluent Waits)
6. **Taking Screenshots & Capturing Web Elements**
7. **Automating Forms, Dropdowns, and File Uploads**
8. **Executing JavaScript in Selenium**
9. **Headless Mode & Running Tests in Background**
10. **Cross-Browser Testing & Mobile Emulation**
11. **Building a Page Object Model (POM) Framework**

---

## πŸ“– Advanced Topics

- **CI/CD Integration:** Running Selenium tests in **GitHub Actions** & **Jenkins**
- **Parallel Testing:** Speed up automation using **pytest-xdist**
- **Dockerized Selenium Grid:** Run tests in distributed environments
- **Handling CAPTCHAs:** Using **OCR & AI-based solutions**

---

## 🌐 Supported Browsers

| Browser | Driver | Install Command |
|---------|--------|----------------|
| Chrome | ChromeDriver | `brew install chromedriver` / Manual |
| Firefox | GeckoDriver | `brew install geckodriver` |
| Edge | EdgeDriver | Manual (MS Edge DevTools) |

> **Note:** Make sure the driver version matches your browser version.

---

## πŸ† Contributions

πŸš€ We welcome contributions! If you find a bug, have a feature request, or want to improve existing scripts, feel free to **fork** the repo and submit a **pull request**.

**How to Contribute?**

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Commit changes (`git commit -m "Added new feature"`).
4. Push to your branch (`git push origin feature-name`).
5. Open a pull request.

---

## πŸ“œ License

This project is licensed under the **MIT License** – feel free to use and modify the code.

---

## πŸ”— Resources & References

- [Selenium Official Documentation](https://www.selenium.dev/documentation/)
- [Python Selenium Guide](https://selenium-python.readthedocs.io/)
- [Selenium WebDriver API](https://www.selenium.dev/documentation/webdriver/)

---

## πŸ“¬ Contact

For queries or collaboration, reach out via:

πŸ“§ **Email:** [email protected]
🌐 **GitHub:** [SaadSalmanAkram](https://github.com/saadsalmanakram)
πŸ’Ό **LinkedIn:** [Saad Salman Akram](https://www.linkedin.com/in/saadsalmanakram/)

---

πŸ”₯ **Happy Testing & Web Automation!** πŸ”₯

---