I am using the java and selenium to write the test script for automation. On here the target automated Org has some reminder pop-up windows so it makes the confusion of taking in the command of driver.getWindowHandles() command on my results.
I try the below code to try to Block the pop-up windows on the chrome
System.setProperty("webdriver.chrome.driver", "//chrome path in system//");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("excludeSwitches", "disable-popup-blocking");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
driver = new ChromeDriver(capabilities);
But it's not working it's given the below error and prevent the chrome to launch:
from unknown error: cannot parse excludeSwitches
from unknown error: must be a list
So what I should do for close those pop-up windows. Any answer is appreciated. I am using the chrome version: '2.29.461591' and java.version: '1.8.0_92'