This error message...
selenium.common.exceptions.WebDriverException: Message: GET /session/bbb48fc8-51ba-4cff-b639-771f80489785/window/rect did not match a known command
...implies that the GET method on the /session/{session id}/window/rect endpoint i.e. Get Window Rect failed.
get_window_position
get_window_position() gets the x,y position of the current window.
Note: Supported for W3C compatibile browsers.
I have used your own code at on my Windows 8 box as follows:
from selenium import webdriver
url = 'https://www.google.com'
driver = webdriver.Firefox()
driver.get(url)
print(driver.get_window_position())
But unable to reproduce the error/issue.
However at this point it is worth to mention that different Browser Clients renders the HTML in a different way. You can find a relevant discussion in Chrome & Firefox on Windows vs Linux (selenium).
It is possible as per your Test Configuration the Client (i.e. the Web Browser) returned back the control to the WebDriver instance i.e. 'document.readyState' equal to "complete" before the /session/{session id}/window/rect
endpoint was established.
Solution
Induce WebDriverWait before you try to extract the window_position as follows:
Code Block:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
url = 'https://www.google.com'
driver = webdriver.Firefox()
driver.get(url)
WebDriverWait(driver, 10).until(EC.title_contains("Google"))
print(driver.get_window_position())
Console Output:
{'x': -8, 'y': -8}