`
m635674608
  • 浏览: 4929201 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

geckodriver 关闭日志

 
阅读更多

You can define the desired logging level over command line in geckodriver.exe.

geckodriver.exe -help    
USAGE:
    geckodriver.exe [FLAGS][OPTIONS]...
OPTIONS:--log <LEVEL>SetGecko log level [values: fatal, error, warn, info, config,
            debug, trace]

If you use geckodriver from selenium, you have two option:

  • Start geckodriver.exe separately with custom arguments, and use it from selenium over RemoteWebDriver
  • Create a custom wrapper, to add extra parameters to geckodriver.exe

Example geckodriver wrapper bat file (for windows):

@ECHO OFF
ECHO Starting geckodriver:%0%*.\GeckoDriver\geckodriver.exe --log fatal %*> NUL 2>&1

In java you can define the geckodriver executable path, over webdriver.gecko.driver system property:

System.setProperty("webdriver.gecko.driver","c:/selenium/geckodriver/gdrvwrapper.bat");

https://stackoverflow.com/questions/41387794/how-do-i-disable-firefox-logging-in-selenium-using-geckodriver
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics