# 🧪 Selenium Automation Framework (Python + Pytest + HTML Report)
This project is a simple Selenium automation framework that:
- ✅ Launches Google Search page
- 🔍 Verifies that the search field is visible
- 🧾 Generates an HTML report after test execution
- 🌿 Uses Git for version control
- 🐧 Runs on Linux (tested on Ubuntu)
---
## 📌 Project Structure
selenium_project/
│── tests/
│ └── test_google.py # Selenium test file
│── reports/ # HTML reports will be stored here
│── requirements.txt # Python dependencies
│── README.md # Project documentation
│── .gitignore # Ignored files for Git
└── venv/ # (Optional) Virtual environment
---
## 🛠️ Tech Stack
| Tool / Tech             | Purpose                                              |
|--------------------------|-----------------------------------------------------|
| Python 3.x               | Programming language                                |
| Selenium                 | Browser automation                                 |
| Pytest                   | Test runner framework                              |
| Pytest-HTML              | Test reporting                                     |
| Chrome + ChromeDriver    | Browser & driver for test execution                 |
| Git & GitHub             | Version control and code collaboration              |
---
## ⚙️ 1. Environment Setup (Linux)
### Update and install Python:
```bash
sudo apt update && sudo apt upgrade -y
sudo apt install python3 python3-pip -y
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.debgoogle-chrome --versionwget https://chromedriver.storage.googleapis.com/<YOUR_VERSION>/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/local/bin/
chmod +x /usr/local/bin/chromedriver👉 OR use webdriver-manager (auto downloads driver).
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtIf you don’t have a requirements.txt yet, you can install manually:
pip install selenium pytest pytest-html webdriver-managerThen generate requirements.txt:
pip freeze > requirements.txtpytestpytest --html=reports/test_report.html --self-contained-htmlxdg-open reports/test_report.htmlgit initgit add .
git commit -m "Initial Selenium setup"git remote add origin git@github.com:<your-username>/<repo-name>.gitgit branch -M main
git push -u origin mainfrom selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
def test_google_search_field_visible():
    service = Service(ChromeDriverManager().install())
    driver = webdriver.Chrome(service=service)
    driver.get("https://www.google.com")
    # Verify page loaded
    assert "Google" in driver.title
    # Verify search box is visible
    search_box = driver.find_element(By.NAME, "q")
    assert search_box.is_displayed()
    driver.quit()- ✅ Implement Page Object Model (POM) for better structure.
- 🧭 Integrate with GitHub Actions / Jenkins for CI/CD.
- 📝 Add logging and screenshots for failures.
- 🌐 Run tests in headless mode to save resources.
venv/
__pycache__/
reports/
*.pyc
chromedriver
- ✔️ Simple and maintainable Selenium project
- 📊 Detailed HTML test report generated after execution
- 💻 Compatible with Linux
- 🔐 Code tracked with Git & pushed to GitHub
👨💻 Author: Vinaya Dasepalli. 📧 Contributions and improvements are welcome!
---
✅ **Tip:**  
Once you save this `README.md`, you can preview it directly on GitHub after pushing your code.  
This gives your repo a **professional and structured look**.  
Would you like me to also generate a `requirements.txt` file content for you to include in the repo? (so others can set it up easily) 📦✨