My jenkins failure reports for my functional tests are full of lines like this:
selenium.webdriver.remote.remote_connection: DEBUG: Finished Request
selenium.webdriver.remote.remote_connection: DEBUG: POST http://127.0.0.1:52932/session/60d406aa8e55ac841cf4efb4a43e63be/element {"using": "css selector", "sessionId": "60d406aa8e55ac841cf4efb4a43e63be", "value": "#Login input[name=email]"}
I don't care about them and there are hundreds of these lines of output for every line of stacktrace that I actually want to see. How do I turn them off?
Things I have tried so far that don't work:
from selenium import webdriver
driver = webdriver.Chrome(
service_args=['--silent'],
service_log_path='/tmp/throwaway.log')
And...
from selenium import webdriver
driver = webdriver.Chrome(
service_args=['2>/dev/null'])
And...
from selenium import webdriver
driver = webdriver.Chrome(
service_args=['>', '/dev/null', '2>&1'])
All without reducing any of the output.
You need to set the logging level
on the remote_connection
higher than DEBUG
:
from selenium.webdriver.remote.remote_connection import LOGGER, logging
LOGGER.setLevel(logging.WARNING)
FYI, based on this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With