This error message...
selenium.common.exceptions.WebDriverException: Message: unknown command: session/8252be05ea571a2c623450db8ba097c0/window/minimize
...implies that the call to minimize_window() function wasn't recoznized.
You spotted it correct. As now WebDriver Specification is a W3C Recommendation the function defination for maximizing the window was adjusted as per the W3C Recommended Specification as follows:
def maximize_window(self):
"""
Maximizes the current window that webdriver is using
"""
params = None
command = Command.W3C_MAXIMIZE_WINDOW
if not self.w3c:
command = Command.MAXIMIZE_WINDOW
params = {'windowHandle': 'current'}
self.execute(command, params)
But, the function defination for minimizing the window is still pending to be W3C compliant within the Python Client as is still defined as:
def minimize_window(self):
"""
Invokes the window manager-specific 'minimize' operation
"""
self.execute(Command.MINIMIZE_WINDOW)
Hence you see the error:
unknown command: session/8252be05ea571a2c623450db8ba097c0/window/minimize
Solution
As the default/common practice is to open the browser in maximized mode, while Test Execution is In Progress minimizing the browser would be against the best practices as Selenium may loose the focus over the Browsing Context and an exception may raise during the Test Execution. However, Selenium's python client does have a minimize_window() method which eventually pushes the Chrome Browsing Context effectively to the background.
Python:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get('https://www.google.co.in')
driver.minimize_window()
Java Solution:
driver.navigate().to("https://www.google.com/");
Point p = driver.manage().window().getPosition();
Dimension d = driver.manage().window().getSize();
driver.manage().window().setPosition(new Point((d.getHeight()-p.getX()), (d.getWidth()-p.getY())));