Your question does not state why you want to run your test cases in a minimized browser but unfortunately, Selenium does not provide any built-in function for the same.
Normally when we want to run test cases with the maximized browser we use:
driver.manage().window().maximize();
No doubt there are several ways to minimize your window through code by using Java key events by using keyboard shortcuts for minimizing the window or by using JavaScriptExecuter but that too depending on which OS and language you are working.
One more thing you can try is HtmlUnitDriver.By using this you can't even see the browser, so that may also serve your purpose if you have a case of not opening the browser while execution of test cases.
However, I have an alternate solution that you can try. You can set the position of the WebDriver to be outside of your view. That way, it'll be out of sight while it runs. (It will start at a visible location, but it will be there only for an instant.)
FirefoxDriver driver = new FirefoxDriver();
driver.manage().window().setPosition(new Point(-2000, 0));
If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium automation online training!