Skip to content

[🐛 Bug]: [py] Unable to set window position in Firefox #15584

Open
@cgoldberg

Description

@cgoldberg

Description

When you call driver.set_window_position(x, y) using Firefox, the window position is not set. I am pretty sure this is a geckodriver issue, and I already reported it:

mozilla/geckodriver#2224

I am just reporting it here to track the issue on the Selenium side and will close this once fixed.

The following test is failing in Selenium's Python/Firefox CI job because of this:

FAILED py/test/selenium/webdriver/common/api_example_tests.py::test_move_window_position[firefox] - assert 0 == 50

Reproducible Code

from selenium import webdriver

driver = webdriver.Firefox()
driver.set_window_position(50, 50)

Debugging Logs

Selenium Manager binary found at: /home/cgoldberg617/code/selenium/py/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/cgoldberg617/code/selenium/py/selenium/webdriver/common/linux/selenium-manager --browser firefox --debug --language-binding python --output json
geckodriver not found in PATH
firefox not found in PATH
firefox not found in the system
Required browser: firefox 137.0
firefox 137.0 already exists
firefox 137.0 is available at /home/cgoldberg617/.cache/selenium/firefox/linux64/137.0/firefox
Required driver: geckodriver 0.36.0
geckodriver 0.36.0 already in the cache
Driver path: /home/cgoldberg617/.cache/selenium/geckodriver/linux64/0.36.0/geckodriver
Browser path: /home/cgoldberg617/.cache/selenium/firefox/linux64/137.0/firefox
Started executable: `/home/cgoldberg617/.cache/selenium/geckodriver/linux64/0.36.0/geckodriver` in a child process with pid: 26445 using 0 to output -3
POST http://localhost:53805/session {'capabilities': {'firstMatch': [{}], 'alwaysMatch': {'browserName': 'firefox', 'acceptInsecureCerts': True, 'moz:debuggerAddress': True, 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'moz:firefoxOptions': {'binary': '/home/cgoldberg617/.cache/selenium/firefox/linux64/137.0/firefox', 'prefs': {'remote.active-protocols': 3}}}}}
Remote response: status=200 | data={"value":{"sessionId":"1d307608-760e-4f31-970a-d8bc7290d74f","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"137.0","moz:accessibilityChecks":false,"moz:buildID":"20250327043313","moz:debuggerAddress":"127.0.0.1:49303","moz:geckodriverVersion":"0.36.0","moz:headless":false,"moz:platformVersion":"6.6.67-06628-g571b599e617d","moz:processID":26448,"moz:profile":"/tmp/rust_mozprofile39S6FX","moz:shutdownTimeout":60000,"moz:webdriverClick":true,"moz:windowless":false,"pageLoadStrategy":"normal","platformName":"linux","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0"}}} | headers=HTTPHeaderDict({'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-cache', 'content-length': '814', 'date': 'Mon, 07 Apr 2025 03:46:45 GMT'})
Finished Request
POST http://localhost:53805/session/1d307608-760e-4f31-970a-d8bc7290d74f/window/rect {'x': 50, 'y': 50, 'width': None, 'height': None}
Remote response: status=200 | data={"value":{"x":0,"y":0,"width":488,"height":240}} | headers=HTTPHeaderDict({'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-cache', 'content-length': '48', 'date': 'Mon, 07 Apr 2025 03:46:49 GMT'})
Finished Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-pyPython BindingsD-firefoxI-defectSomething is not working as intendedOS-linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions