Create a instance of ChromeOptions class
ChromeOptions options = new ChromeOptions();
Then Add chrome switch to disable notification - "--disable-notifications"
options.addArguments("--disable-notifications");
After that set path for driver exe
System.setProperty("webdriver.chrome.driver","path/to/driver/exe");
and then pass ChromeOptions instance to ChromeDriver Constructor
WebDriver driver =new ChromeDriver(options);
Hope this helps!
Join our Selenium online training here for more details!
Thanks!