Turns out, ChromeDriver has a default switch that enables logging – -enable-logging you need to pass this to Selenium to turn it off. So, anything passed through excludeSwitches basically negates / removes a flag normally set as true by ChromeDriver. The solution involves the use of excludeSwitches – these are switches / flags that you want to exclude ChromeDriver from including by default. I still got messages after creating a webdriver instance with these preferences Solution My first attempt tried to use this approach and failed: const wdLogging = require('selenium-webdriver/lib/logging') Ĭonst loggingPrefs = new wdLogging.Preferences() To be clear, even if you explicitly tell Selenium that you want all logging off, you will still get this message. To start with, it seems at first as though it is impossible to get rid of this log message: “ DevTools listening on ws://.” when first connecting. The issue, which you can find many users complaining about, is that when using Chrome as the browser with Selenium Webdriver and NodeJS, the default log preferences don’t seem to be respected and messages still appear in the console / stdout. This is a quick post, but took a little digging to come up with the solution featured.
0 Comments
Leave a Reply. |