Skip to content
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

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

Open
aikfiend opened this issue Mar 24, 2025 · 4 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended

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 is the error, 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 on the screenshot. In my case it was BrowserStack.

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

Please note, the code of test provided is not reproducing the issue in 100% cases, as the issue itself reproduces from time to time depending on a remote web server. You may require hundreds or more retries, as I am capturing such exceptions sometimes when running test sessions infinitely in 24x7 mode. Here are details of remote device geoip:

{
    "geoip": {
        "continent": "AS",
        "country": "IN",
        "region": "Maharashtra",
        "region_code": "MH",
        "city": "Mumbai",
        "asn": 18229,
        "organization": "CtrlS"
    },
    "ip_address": "185.255.127.180",
    "user_agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.36"
}

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
@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
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
Projects
None yet
Development

No branches or pull requests

2 participants