Skip to content

[🐛 Bug]: Message KeyError 'width' while trying to get_window_size() does not provide detailed information #15503

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
aikfiend opened this issue Mar 24, 2025 · 10 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended J-issue-template Applied to issues not following the template, or missing information.

Comments

@aikfiend
Copy link

aikfiend commented Mar 24, 2025

What happened?

Image
So from the user's point of view, it is not clear on which side the error is, the webdriver itself or the remote web server.

How can we reproduce the issue?

It is hard to reproduce, but the remote web server used for the remote webdriver should be unreliable and return an error, as shown in the screenshot. In my case, it was BrowserStack Automate.

As requested in the comment:
https://github.com/aikfiend/python-selenium-browserstack/tree/get-window-size-key-error

Please note that the code of the test provided does not reproduce the issue in 100% of cases, as the issue itself reproduces from time to time, depending on a remote web server. You may require hundreds or more retries.

In the period from 2025-03-11 to 2025-04-21, I was able to catch it 20 times running tests in 24/7 mode in Browserstack Automate. Commonly, it failed in Chrome and Safari on mobile devices.

Relevant log output

Let the sentry speak for itself

Operating System

Any

Selenium version

4.31.0 (trunk)

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

Any

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

Any

Are you using Selenium Grid?

No response

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

@aikfiend, 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!

aikfiend added a commit to aikfiend/selenium that referenced this issue Mar 24, 2025

Verified

This commit was signed with the committer’s verified signature.
mcous Michael Cousins
… and get_window_position (SeleniumHQ#15503)
@cgoldberg
Copy link
Contributor

Can you provide some code to reproduce this?

@aikfiend
Copy link
Author

Can you provide some code to reproduce this?

yep, but let me ask you first if you really try to reproduce it using the code provided

@cgoldberg
Copy link
Contributor

If you provide code that can reproduce it, Someone will attempt to reproduce it... or at least understand the scenario under which it occurs.

aikfiend added a commit to aikfiend/selenium that referenced this issue Mar 25, 2025

Verified

This commit was signed with the committer’s verified signature.
mcous Michael Cousins
… and get_window_position (SeleniumHQ#15503)
@cgoldberg
Copy link
Contributor

closing since OP never provided code to reproduce.

@cgoldberg cgoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2025
@aikfiend
Copy link
Author

closing since OP never provided code to reproduce.

see description for code to reproduce the issue

@cgoldberg cgoldberg added the J-issue-template Applied to issues not following the template, or missing information. label Apr 11, 2025
@selenium-ci
Copy link
Member

Hi, @aikfiend.
Please follow the issue template; we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided. Thank you.

@cgoldberg
Copy link
Contributor

cgoldberg commented Apr 11, 2025

Please provide a full example of code showing how to reproduce this. The one line you provided is not sufficient. You also need to provide a URL/HTML where this can be reproduced, along with debug logs:

https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/

Also, provide the browser/driver versions and operating system you are using (as was asked for in the issue template)

@aikfiend
Copy link
Author

Did you saw this:
https://github.com/aikfiend/python-selenium-browserstack/tree/get-window-size-key-error

And device geoip from description?

@cgoldberg
Copy link
Contributor

Please provide the debug logs.

Does this happen on browsers besides Mobile Safari? (like desktop Safari or Chrome?)

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! I-defect Something is not working as intended J-issue-template Applied to issues not following the template, or missing information.
Projects
None yet
Development

No branches or pull requests

3 participants