Headless Browser in Chrome 137 suddenly stopped maximising or windows size is not set 1920*1080. Below is my robot keyword. Does any one face this issue when running headless with latest chromedriver. Any help much appreciated please?

Use Chrome Browser for UIAutomation
${prefs}= Create Dictionary
… profile.default_content_setting_values.automatic_downloads=1
… download.default_directory=${default_download_directory}
… download.prompt_for_download=False
${chrome options}= Evaluate sys.modules[‘selenium.webdriver’].ChromeOptions() sys, selenium.webdriver

Call Method    ${chrome options}    add_argument    ${browsermode}
Call Method    ${chrome options}    add_argument    --start-maximized
Call Method    ${chrome options}    add_argument    --disable-gpu
Call Method    ${chrome options}    add_argument    --disable-extensions
Call Method    ${chrome options}    add_argument    --disable-sync
Call Method    ${chrome options}    add_argument    --no-default-browser-check
Call Method    ${chrome options}    add_argument    --no-first-run
Call Method    ${chrome options}    add_argument    --no-sandbox
Call Method    ${chrome options}    add_argument    --disable-dev-shm-usage
${log_level}=    Evaluate    "--log-level=3"
${window_size}=    Evaluate    "--window-size=1920,1080"
Call Method    ${chrome options}    add_argument    ${log_level}
Call Method    ${chrome options}    add_argument    ${window_size}
Call Method    ${chrome options}    add_experimental_option    prefs    ${prefs}

Create Webdriver    Chrome    options=${chrome options}

Hi, I’ve had this problem for a couple of weeks now.
Chrome update broke headless, all chrome driver options failed for me, tried many, including ones in your code.
If no one has a solution, I’m afraid we’ll have to wait for bugfix by Google. :frowning:
For reference, here’s a link I found today: [🐛 Bug]: ChromeDriver not honoring the --window-size parameter · Issue #15827 · SeleniumHQ/selenium · GitHub

1 Like