How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?

前端 未结 28 2248
悲&欢浪女
悲&欢浪女 2020-11-29 18:20

Is there any way to maximize the browser window using WebDriver (Selenium 2) with C#?

28条回答
  •  执念已碎
    2020-11-29 18:31

    You can try with this code to maximize chrome window.

    ChromeOptions options = new ChromeOptions();
    options.addArguments("--window-size=1920,1080");
    
    WebDriver driver = new ChromeDriver(options);
    

提交回复
热议问题