Skip to content

[πŸ› Bug]: ChromeOptions for window size not working with Chrome 137.0.7151.68-1 on Linux using Selenium v4.33.Β #15854

@nikhil-shukla

Description

@nikhil-shukla

Description

Summary:

Setting window resolution via chrome_options.add_argument("--window-size=1920,1080") does not take effect when using Chrome 137.0.7151.68-1 on a Linux machine in headless mode.

Environment

OS: RHEL Linux (Ubuntu 22.04)
Chrome Version: 137.0.7151.68-1
Selenium Version: 4.33
Python Version: 3.13.3

Reproduction Steps

1. Code: Run the code below       

2. Observe the output window size.

Expected Behaviour - The browser window should open with a resolution of 1920,1080.

Actual Behaviour - The browser opens in a smaller default size (e.g., ~800x600), ignoring the --window-size argument.

Reproducible Code

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--window-size=1920,1080")
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")
print(driver.get_window_size())
driver.quit()

Metadata

Metadata

Assignees

No one assigned

    Labels

    G-chromedriverRequires fixes in ChromeDriver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions