Selenium + Python · Lesson 31 of 43
Module 31: Browser Options & Capabilities
Your task
Implement build_headless_chrome_options():
Write it in the editor, then press Check answer (Ctrl + Enter).
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("--headless=new")
options.add_argument("--window-size=1920,1080")
options.add_argument("--disable-notifications")
options.add_argument("--incognito")
driver = webdriver.Chrome(options=options)Running tests on headless servers and configuring custom capabilities requires browser Options classes. In this lesson, you will master ChromeOptions with --headless=new and configuring window sizes. Let's configure browser options!
Part of the Selenium + Python course (Selenium with Python). Practice this concept live in the Selenium Online Compiler or explore our free automation practice form.
In Chrome 109+, '--headless=new' uses the modern rendering engine, behaving identically to the real user browser.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___