Skip to content

[🐛 Bug]: driver fails calling to minimize_browser() with error: failed to change window state to 'minimized', current state is 'normal' (Linux ENV) #15192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bwomsm1 opened this issue Jan 30, 2025 · 16 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! G-chromedriver Requires fixes in ChromeDriver I-defect Something is not working as intended

Comments

@bwomsm1
Copy link

bwomsm1 commented Jan 30, 2025

What happened?

I am running the following simple test script:

import time
from selenium import webdriver

driver = webdriver.Chrome()
driver.get('http://www.google.com')

time.sleep(2)
driver.minimize_window()
time.sleep(5)

driver.quit()

My script failed in line 7 when calling to driver.minimize_window() with the following error:

Message: unknown error: failed to change window state to 'minimized', current state is 'normal'
  (Session info: chrome=132.0.6834.159)

How can we reproduce the issue?

Run the follwing script:

import time
from selenium import webdriver

driver = webdriver.Chrome()
driver.get('http://www.google.com')

time.sleep(2)
driver.minimize_window()
time.sleep(5)

driver.quit()

Against Linux ENV:

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Relevant log output

Message: unknown error: failed to change window state to 'minimized', current state is 'normal'
  (Session info: chrome=132.0.6834.159)

Operating System

Linux Debian GNU/Linux 12 (bookworm)

Selenium version

Python Selenium 4.26.0

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

132.0.6834.159

Are you using Selenium Grid?

NO

@bwomsm1 bwomsm1 added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels Jan 30, 2025
Copy link

@bwomsm1, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@pujagani
Copy link
Contributor

pujagani commented Jan 31, 2025

I have tried to reproduce this on MacOS and unable to with Java. I doubt it is language-specific but will try with Python as well. What version of Chromedriver are you using? Does it occur with Firefox or other versions of Chrome?

@pujagani
Copy link
Contributor

Even with python, the behavior is expected.

@pujagani pujagani added J-awaiting answer Question asked of user; a reply moves it to triage again and removed A-needs-triaging A Selenium member will evaluate this soon! labels Jan 31, 2025
@bwomsm1
Copy link
Author

bwomsm1 commented Jan 31, 2025

I am experiencing the problem with ChromeOS, my test is running from the Linux CMD in the Chromebook.

@bwomsm1
Copy link
Author

bwomsm1 commented Jan 31, 2025

My guess is that if you will run it in the env PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" you will also be able to see the problem

@github-actions github-actions bot added A-needs-triaging A Selenium member will evaluate this soon! and removed J-awaiting answer Question asked of user; a reply moves it to triage again labels Jan 31, 2025
@bwomsm1
Copy link
Author

bwomsm1 commented Feb 3, 2025

@pujagani and all, any news about this issue? The problem is easily reproducing against Linux environments.

@pujagani
Copy link
Contributor

pujagani commented Feb 4, 2025

If it is specific to Linux environments, only reproducible with Chrome, then there is a good chance it is a Chrome issue.

@bwomsm1
Copy link
Author

bwomsm1 commented Feb 4, 2025

If it is specific to Linux environments, only reproducible with Chrome, then there is a good chance it is a Chrome issue.

It is reproducing with various of Linux OSs, also my team mates are experiencing the problem

@shbenzer
Copy link
Contributor

@bwomsm1 Have you reproduced this error with Firefox, Safari, or Edge?

@bwomsm1
Copy link
Author

bwomsm1 commented Feb 11, 2025

@shbenzer no, my case is Chrome

@pujagani
Copy link
Contributor

I have tried to go through a few issues where the same error message was seen. In the past, this issue has been related to the ChromeDriver. Many old Chromium bugs reported by users have the same error message. Please file a bug report with them.

SeleniumHQ/docker-selenium#559

@pujagani pujagani added the G-chromedriver Requires fixes in ChromeDriver label Mar 24, 2025
Copy link

Hi, @bwomsm1.
This issue has been determined to require fixes in ChromeDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an issue with the ChromeDriver team.
Feel free to comment the issues that you raise back in this issue. Thank you.

@cgoldberg
Copy link
Contributor

FWIW, I can reproduce this issue on Debian/Linux with Selenium 4.30 and Chrome/ChromeDriver 134.

calling driver.minimize_window() immediately crashes Chrome with the error message in this issue. The same thing happens with Microsoft Edge, but not with Firefox. (driver.maximize_window() works fine btw)

@bwomsm1 , Have you filed a bug on the Chromium tracker? This definitely seems to be a Chrome/Chromium bug.

I am going to temporarily re-open this issue until we link it to a Chrome bug report.

@cgoldberg cgoldberg reopened this Mar 24, 2025
@bwomsm1
Copy link
Author

bwomsm1 commented Mar 25, 2025

@cgoldberg I am facing the problem with Chrome, when running in ChromeOS (which is a Debian/Linux based)
I did not raise an issue to ChromeDriver/Chromium, we should.

@cgoldberg
Copy link
Contributor

@bwomsm1 yes, I also reproduced it on Debian (in ChromeOS), though I suspect it happens on any Linux distro, if not every platform.

Can you open a new issue in the Chromium tracker and link to it here? (The link to Chromium tracker is in a previous comment)

@titusfortner titusfortner added G-chromedriver Requires fixes in ChromeDriver and removed G-chromedriver Requires fixes in ChromeDriver labels Mar 25, 2025
Copy link

Hi, @bwomsm1.
This issue has been determined to require fixes in ChromeDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an issue with the ChromeDriver team.
Feel free to comment the issues that you raise back in this issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! G-chromedriver Requires fixes in ChromeDriver I-defect Something is not working as intended
Projects
None yet
Development

No branches or pull requests

5 participants