Course → 1 · Selenium automation → Headless & Next Steps
1 · Selenium automation
Headless Chrome and CI tips
10 min · Module 13
Headless mode is useful in CI. Also set a window size, use unique test data, and keep selectors stable.
- Run the app under test before the suite.
- Fail fast with clear assertion messages.
- Store screenshots on failure for debugging.
Example / notes
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("--headless=new")
options.add_argument("--window-size=1280,800")
driver = webdriver.Chrome(options=options)
driver.get("http://127.0.0.1:8000/lab/")
driver.save_screenshot("lab_hub.png")
driver.quit()
Practice in Lab: /lab/
Modules in this track
- 6. Getting Started
- 7. Finding Elements
- 8. Interactions
- 9. Waits
- 10. Assertions & Structure
- 11. Page Object Model
- 12. Alerts, Frames & Windows
- 13. Headless & Next Steps