Skip to main content
added 120 characters in body
Source Link
PDHide
  • 11.1k
  • 2
  • 16
  • 43

You can also suppress error message using ChromeDriverService class:

    WebDriver browser = null;
    
    ChromeDriverService service = new ChromeDriverService.Builder()
            .usingDriverExecutable(new File("C:\\chromedriver.exe")).usingPort(4444).withSilent(true)
            .build();
        service.start();
        
        
        
        browser = new RemoteWebDriver(service.getUrl(), new ChromeOptions());

and once the test is over stop the service , else the port remains opened.

browser.quit()
service.stop()

You can also suppress error message using ChromeDriverService class:

    WebDriver browser = null;
    
    ChromeDriverService service = new ChromeDriverService.Builder()
            .usingDriverExecutable(new File("C:\\chromedriver.exe")).usingPort(4444).withSilent(true)
            .build();
        service.start();
        
        
        
        browser = new RemoteWebDriver(service.getUrl(), new ChromeOptions());

You can also suppress error message using ChromeDriverService class:

    WebDriver browser = null;
    
    ChromeDriverService service = new ChromeDriverService.Builder()
            .usingDriverExecutable(new File("C:\\chromedriver.exe")).usingPort(4444).withSilent(true)
            .build();
        service.start();
        
        
        
        browser = new RemoteWebDriver(service.getUrl(), new ChromeOptions());

and once the test is over stop the service , else the port remains opened.

browser.quit()
service.stop()
Source Link
PDHide
  • 11.1k
  • 2
  • 16
  • 43

You can also suppress error message using ChromeDriverService class:

    WebDriver browser = null;
    
    ChromeDriverService service = new ChromeDriverService.Builder()
            .usingDriverExecutable(new File("C:\\chromedriver.exe")).usingPort(4444).withSilent(true)
            .build();
        service.start();
        
        
        
        browser = new RemoteWebDriver(service.getUrl(), new ChromeOptions());