Passing options to chrome driver selenium

后端 未结 4 1781
北恋
北恋 2020-12-31 12:56

I am trying to disable the output to the console for chrome. If I pass the --start-maximized option it works fine. I may have the wrong command?

DesiredCapab         


        
4条回答
  •  抹茶落季
    2020-12-31 13:16

    When I was setting chrome up with

      selenium-chrome-driver-2.48.2.jar
      chromedriver 2.20
      selenium-java-2.48.2.jar
    

    none of the above answers worked for me, Since I see some of the answers are a few years old, I will post what worked for me.

        ChromeOptions chromeOptions = setupChromeOptions();
        System.setProperty("webdriver.chrome.logfile", "\\path\\chromedriver.log");
        System.setProperty("webdriver.chrome.driver", "\\path\\chromedriver.exe");
        System.setProperty("webdriver.chrome.args", "--disable-logging");
        System.setProperty("webdriver.chrome.silentOutput", "true");
        driver = new ChromeDriver(chromeOptions);
    

提交回复
热议问题