If you’re a QA engineer stepping into automation — or an SDET who just needs a quick refresher — this cheat sheet covers the Selenium + Python essentials you actually use at work.
No theory overload. No outdated patterns. Just practical examples you can copy, adapt, and scale.
Thanks for reading! Subscribe for free to receive new posts and support my work.
✅ Setup & Installation
Install Selenium:
pip install selenium
Make sure the correct browser driver is available in your system PATH:
Chrome → chromedriver
Firefox → geckodriver
Edge → msedgedriver
🚀 Starting the Browser
Launch Chrome
from selenium import webdriver
driver = webdriver.Chrome()
driver.get(” https://example.com” )
Headless Mode (Recommended for CI)
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument(”--headless”)
options.add_argument(”--window-size=1920,1080”)
driver = webdriver.Chrome(options=options)
🔍 Locating Elements (The Most Important Skill)
Always prioritize reliable,…