1. Install Python
🔹 Steps:
-
Download Python (latest stable, e.g., 3.12.x)
👉 https://www.python.org/downloads/ -
During installation:
-
✅ Check “Add Python to PATH”
-
✅ Install
pip
(package manager)
-
-
Verify installation:
2. Set Up Environment
🔹 Virtual Environment
Always isolate projects using venv
or pipenv
.
You should see (venv)
in your terminal.
🔹 Install Core Packages
Optional (for advanced use):
3. Start with a Small Example
🔹 Web Automation Example (Selenium + pytest)
-
Install browser driver (e.g., ChromeDriver).
-
Download: https://chromedriver.chromium.org/
-
Keep
chromedriver.exe
in PATH or project folder.
-
-
Create
test_google.py
:
-
Run test:
👉 Generates report.html
with results.
4. API Automation Example (pytest + requests)
Create test_api.py
:
Run:
5. Build a Mini Automation Framework (Skeleton)
Project Structure:
-
tests/
→ UI + API test cases -
pages/
→ Page Object Model for UI -
utils/
→ Config, helpers -
conftest.py
→ pytest fixtures -
pytest.ini
→ markers, test configs
✅ This is a reusable base for real projects.
6. Integrate with CI/CD
🔹 Option A: Jenkins
-
Install Jenkins (download)
-
Install plugins:
-
Git Plugin
-
Pytest Plugin (or Allure)
-
-
Create a Jenkins Job:
-
Pull code from GitHub
-
Add build step:
-
Archive
report.html
as test report.
-
🔹 Option B: GitHub Actions
-
In your repo, create
.github/workflows/python-tests.yml
:
-
Push code → GitHub Actions runs tests automatically.
7. Scaling Up
-
Add parallel execution:
pytest -n 4
(withpytest-xdist
) -
Add cross-browser testing: BrowserStack/Sauce Labs integration
-
Add Allure Reports for rich reporting
-
Add Dockerfile to containerize the framework
✅ Summary Roadmap
-
Install Python + pip + venv
-
Install pytest, selenium, requests
-
Write UI & API tests
-
Create framework structure
-
Integrate with CI/CD (Jenkins/GitHub Actions)
-
Scale with parallel execution, cloud, reporting