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 -
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#?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With