Sameera De Silva
1 min readSep 17, 2020

How to avoid ChromeDriver version been printed in console

As a project requirement, I want to avoid printing below details .

Starting ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e) on port 32241
Only local connections are allowed.
Sep 17, 2020 10:44:29 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS

To solve this can use below property .

System.setProperty(“webdriver.chrome.silentOutput”, “true”);

It will give only

Sep 17, 2020 10:45:34 AM org.openqa.selenium.remote.ProtocolHandshake createSession

INFO: Detected dialect: OSS

Sample code-

@BeforeClass()
public void setUp() {
System.setProperty(“webdriver.chrome.driver”,System.getProperty(“user.dir”)+”\\Jar_files\\chromedriver.exe”);
System.setProperty(“webdriver.chrome.silentOutput”, “true”);
ChromeOptions options = new ChromeOptions();
options.addArguments(“disable-infobars”);
driver = new ChromeDriver(options);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
}

No responses yet