Maximize browser window for Firefox with Selenium WebDriver C#
11,575
For Firefox use -
driver.Manage().Window.Maximize();
You can check this link for more details - How do I maximize the browser window in Selenium WebDriver (Selenium 2) using C#?
Author by
Cr123
Updated on June 19, 2022Comments
-
Cr123 almost 2 years
For Chrome I have this code :
List<String> capabilityValue = new List<string>(); capabilityValue.Add("--start-maximized"); capabilities = DesiredCapabilities.Chrome(); capabilities.SetCapability("chrome.switches", capabilityValue); capabilities.Platform = new Platform(platform); WebDriver driver = new WebDriver ("www.google.com", capabilities);
I try to replace
chrome.switches
withfirefox.switches
. For Mozilla Firefox this doesn't work.Can anyone know how can I open site as maximized?