Simple question: how to completely disable logging when using Selenium from Python bindings, ex code as follows:
browser = webdriver.Chrome()
I’ve tried things like:
options = webdriver.ChromeOptions();
options.add_argument('--log-level 3')
browser = webdriver.Chrome(chrome_options=options)
or even:
options = webdriver.ChromeOptions();
options.add_argument('--disable-logging')
browser = webdriver.Chrome(chrome_options=options)
but still the file ‘chromedriver.log’ is appearing on each new run of the tests.
The source code of Chrome’s webdriver, shows the existence of an option called
service_log_path.So if you want to get rid of the file, you could set this property to
/dev/nullif you are running under Linux/Unix ;NULunder windowsHope it helps