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 with firefox.switches. For Mozilla Firefox this doesn’t work.
Can anyone know how can I open site as maximized?
For Firefox use –
You can check this link for more details – How do I maximize the browser window in Selenium WebDriver (Selenium 2) using C#?