ChromeDriver(Capabilities capabilities) is deprecated

后端 未结 2 468
鱼传尺愫
鱼传尺愫 2020-12-03 06:26

I use ChromeDriver 2.33 with WebDriver 3.6.0 and try to set default directory for file download.

Map prefs =          


        
2条回答
  •  情话喂你
    2020-12-03 06:42

    The new way to use chrome capabilities is like this :

    ChromeOptions options = new ChromeOptions();
        // Proxy proxy = new Proxy();
        // proxy.setHttpProxy("myhttpproxy:3337");
        // options.setCapability("proxy", proxy);
        // options.addArguments("--headless");
        // options.addArguments("--disable-gpu");
        // options.setAcceptInsecureCerts(true);
        // options.addArguments("--allow-insecure-localhost");
        // options.addArguments("--lang=fr-CA");
        options.addArguments("--start-maximized");
    driver = new ChromeDriver(options);
    

    You can get more options by looking at this site : https://sites.google.com/a/chromium.org/chromedriver/capabilities

提交回复
热议问题