Smart WebDriver management library with automatic caching
Project description
driverManagementPro
Smart WebDriver management library with automatic caching - No rate limiting, no re-downloads!
๐ฏ Why driverManagementPro?
Problem
- Running tests on 100+ systems simultaneously causes GitHub API rate limiting
- Downloading drivers repeatedly wastes bandwidth and time
- WebDriver Manager API gets exhausted quickly
Solution
- โ Smart Caching - Download once, use everywhere
- โ Automatic - Downloads only on first run
- โ No Rate Limiting - Never hits GitHub API again
- โ Lightweight - Pure Python, minimal dependencies
- โ Easy to Use - One-liner driver setup
๐ฆ Installation
From PyPI (Recommended)
pip install driverManagementPro
From Source
git clone https://github.com/yourusername/driverManagementPro.git
cd driverManagementPro
pip install -e .
๐ Quick Start
Basic Usage
from driverManagementPro import DriverManager
# Initialize manager
manager = DriverManager()
# Get Chrome driver (auto-downloads if needed)
driver = manager.get_chrome_driver()
driver.get("https://www.google.com")
driver.quit()
Firefox Driver
driver = manager.get_firefox_driver()
driver.get("https://www.google.com")
driver.quit()
Edge Driver
driver = manager.get_edge_driver()
driver.get("https://www.google.com")
driver.quit()
Custom Cache Directory
manager = DriverManager(cache_dir="C:\\custom\\driver\\path")
driver = manager.get_chrome_driver()
Custom Driver Versions
# Specific Chrome version
driver = manager.get_chrome_driver(version="122.0.0.0")
# Specific Firefox version
driver = manager.get_firefox_driver(version="v0.33.2")
# Specific Edge version
driver = manager.get_edge_driver(version="122.0.0.0")
Custom Chrome Options
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("--headless")
options.add_argument("--no-sandbox")
driver = manager.get_chrome_driver(options=options)
๐ Cache Structure
Drivers are cached in user home directory:
~/driverManagementPro/
โโโ chrome/
โ โโโ 123.0.0.0/
โ โ โโโ chromedriver.exe
โ โโโ 124.0.0.0/
โ โโโ chromedriver.exe
โโโ firefox/
โ โโโ v0.33.3/
โ โ โโโ geckodriver.exe
โ โโโ v0.33.2/
โ โโโ geckodriver.exe
โโโ edge/
โโโ 123.0.0.0/
โ โโโ msedgedriver.exe
โโโ 124.0.0.0/
โโโ msedgedriver.exe
๐ง Advanced Usage
Check Cache Status
manager = DriverManager()
# List all cached drivers
cached = manager.list_cached_drivers()
print(cached)
# Output: {'chrome': ['123.0.0.0', '124.0.0.0'], 'firefox': ['v0.33.3']}
# Health check
if manager.health_check():
print("โ
Cache directory is accessible")
else:
print("โ Cache directory issue")
Clear Cache
manager = DriverManager()
# Clear all drivers
manager.clear_cache()
# Clear all Chrome drivers
manager.clear_cache("chrome")
# Clear specific version
manager.clear_cache("chrome", "123.0.0.0")
Debug Mode
manager = DriverManager(debug=True)
driver = manager.get_chrome_driver() # Verbose logging
๐ข Use Cases
Single System (Local Development)
from driverManagementPro import DriverManager
manager = DriverManager()
driver = manager.get_chrome_driver()
# Drivers cached locally - subsequent runs are instant
Multiple Systems (QA Teams)
# System 1: Downloads driver once
manager = DriverManager()
driver = manager.get_chrome_driver()
# System 2-100: Use cached drivers instantly
# No GitHub API calls, no rate limiting!
CI/CD Pipelines
# Jenkins, GitHub Actions, Azure Pipelines
import os
from driverManagementPro import DriverManager
# Optional: use custom cache directory
cache_path = os.getenv("DRIVER_CACHE", None)
manager = DriverManager(cache_dir=cache_path)
driver = manager.get_chrome_driver()
# Run your tests...
driver.quit()
Packaged Applications (EXE)
# Your Python application packaged as EXE
# Drivers are cached on first run
# Subsequent runs use cached drivers
from driverManagementPro import DriverManager
manager = DriverManager()
driver = manager.get_chrome_driver()
# Works perfectly when distributed to clients!
๐ Performance Comparison
| Scenario | Without Cache | With driverManagementPro |
|---|---|---|
| First Run | 30-60 sec | 30-60 sec (download) |
| 2nd-100th Run | 30-60 sec each | < 1 sec each |
| 100 systems, 1st time | โ Rate Limited | โ Works fine |
| Bandwidth | 500 MB total | 5 MB (one download) |
๐ Security
- No credentials stored in code
- No hardcoded tokens needed
- Local cache only - drivers never exposed
- HTTPS downloads from official sources
๐ Troubleshooting
Issue: "Failed to get ChromeDriver"
Solution 1: Check connectivity
manager = DriverManager(debug=True)
manager.health_check()
Solution 2: Clear cache and retry
manager.clear_cache("chrome", "123.0.0.0")
driver = manager.get_chrome_driver(version="123.0.0.0")
Solution 3: Use different version
# Try a different version
driver = manager.get_chrome_driver(version="122.0.0.0")
Issue: Permission denied (Linux/Mac)
Solution:
chmod +x ~/driverManagementPro/*/chromedriver
chmod +x ~/driverManagementPro/*/geckodriver
Issue: Cache directory not accessible
Solution:
# Use custom writable directory
manager = DriverManager(cache_dir="/tmp/drivers")
๐งช Testing
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# With coverage
pytest --cov=driverManagementPro
๐ License
MIT License - See LICENSE file for details
๐ค Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
๐ Support
- ๐ง Email: qa@example.com
- ๐ Issues: https://github.com/yourusername/driverManagementPro/issues
- ๐ Documentation: https://github.com/yourusername/driverManagementPro/wiki
Made with โค๏ธ for QA Teams
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drivermanagementpro-1.0.2.tar.gz.
File metadata
- Download URL: drivermanagementpro-1.0.2.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cec551d9853276335b5f04a6162d0012f5f95af6a6ccc41ee09d52634ca7a43
|
|
| MD5 |
eb32433e158d6c1213e041d803174f72
|
|
| BLAKE2b-256 |
14093cd68854915c0a48f4cd50d345536902be0329a0c6c91f5acf269475b90c
|
File details
Details for the file drivermanagementpro-1.0.2-py3-none-any.whl.
File metadata
- Download URL: drivermanagementpro-1.0.2-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eca03c8dfb2adc005830f1c81f0a103e1bec0c0f43cb45df12f638866d02b2b
|
|
| MD5 |
97c5c1b1ae556692ac910aea2295f754
|
|
| BLAKE2b-256 |
d052de53085e9ebb12cdd367b8da1a1263492f31110e5f04b6af651cf303aa70
|