Maximize Window - Chromedriver 133

Hi !

I’m wondering if some Linux users are experiencing issues with Chromium/Chromedriver last release 133, and Seleniumlibrary Maximize Browser Window.

I have this setup/packages:
→ RF v7.0, Selenium 4.24.0, Seleniumlibrary 6.6.1, Xvfb 2.21 (for docker/debian)

This works well on:

  • Windows machine, Chrome 132/133
  • Docker Linux/Debian, Chrome 132

But on Docker Linux/Debian, Chrome 133, Maximize Browser Window fails/crash with:

WebDriverException: Message: unknown error: JavaScript code failed from unknown command: ‘Runtime.evaluate’ wasn’t found (Session info: chrome=133.0.6943.53)

Code is basically this:

Open Browser   https://google.com    chrome 
Maximize Browser Window

Or the maximize is attempted also this way:

${seleniumlib}    Get Library Instance    SeleniumLibrary
VAR    ${webdriver}    ${seleniumlib.driver}
Call Method    ${webdriver}    maximize_windows

This crashes in both cases as mentioned above.
I tried also to pass --start-maximized that has no effect (I think it’s deprecated).

And Set Window Size keyword works.
I have reported a bug on chromium tracker, but I’m wondering if I don’t miss something…

Regards
Charlie

Hi, Charlie! This problem reproduces periodically from release to release and not only on Chrome, unfortunately. In some cases I specifically excluded such method due to unexpected UI behavior and broken runs. Good that manually it worked like a charm! Let me please clarify - are you checking page responsiveness that you need to maximize the page?

Hi Charlie!

You are not alone in experiencing issues with the Maximize Browser Window command in Chromium/Chromedriver 133 on Docker Linux/Debian. This problem has been reported by other users as well2. Here are a few insights and potential workarounds:

Issue Summary:
Environment: RF v7.0, Selenium 4.24.0, Seleniumlibrary 6.6.1, Xvfb 2.21 (for Docker/Debian).

Problem: Maximize Browser Window fails with WebDriverException: Message: unknown error: JavaScript code failed from unknown command: ‘Runtime.evaluate’ wasn’t found.

Working Setups:

Windows machine, Chrome 132/133.

Docker Linux/Debian, Chrome 132.

Failing Setup: Docker Linux/Debian, Chrome 133.

Potential Workarounds:
Use Set Window Size: Since Set Window Size works, you can use it as an alternative to manually set the window size to the desired dimensions.

Disable Status Bar: Some users have found that disabling the status bar in the view menu and restarting the application can help mitigate high ReadTheory org CPU usage issues.

Older Chrome Version: As a temporary solution, you might consider downgrading to Chrome version 132, which seems to work without issues.

Best Regard,
Amy

1 Like

@joaoroberto

I was wondering why I didn’t used the –start-maximized and retried.
But although this works on a local machine with actual screen and window management, this unfortunately doesn’t work in a docker with xvfb…

Eventually the solution is to use either the Set Windows Size keyword, or to pass it also with the position (in my case I have sometimes full screen captures, so the start position is important:

Call Method    ${chrome_options}    add_argument    --window-position=0,0
Call Method    ${chrome_options}    add_argument    --window-size=1920,1080

Regards
Charlie