Unable to Maximize browser when running through Jenkins as windows service
I have seen the same on TeamCity since it runs again as Windows service (on a virtual Desktop). After playing around with Firefox profiles, we had to use Full screen mode. Example code bellow (C#):
//Make Firefox fullscreen for TeamCity agent's runs_driver.Manage().Window.Maximize();((IJavaScriptExecutor)_driver).ExecuteScript("window.resizeTo(screen.width, screen.height)");_driver.Manage().Window.Position = new Point(0, 0);_driver.Manage().Window.Size = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);_driver.FindElement(By.CssSelector("body")).SendKeys(Keys.F11);_driver.Navigate().GoToUrl("about:blank");
Chrome also support such workaround.