Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress console error/warning/info messages when executing selenium python scripts using chrome canary

I am running python script (complete script link below) for selenium test using Chrome Canary. The test seems to be running fine, however, there are lots of error/warning/info messages displayed on the console.

Is there a way to suppress these messages? I have tried: chrome_options.add_argument("--silent"), but does not help. I am not able to find the right solution. Appreciate any help.

Python script : Example script provided here

Python: 3.6.3 Selenium: 3.6.0 Chrome Canary: 63.0.3239.5 (64 bit) ChromeDriver : 2.33

Console messages

like image 875
Gagan Shrestha Avatar asked Oct 14 '17 13:10

Gagan Shrestha


1 Answers

Try options.add_argument('log-level=3').

log-level:  Sets the minimum log level. Valid values are from 0 to 3:       INFO = 0,      WARNING = 1,      LOG_ERROR = 2,      LOG_FATAL = 3.  default is 0. 
like image 168
nosam Avatar answered Sep 22 '22 03:09

nosam