I want to disable chrome notifications. I know the below code works but driver = new ChromeDriver(ops) invokes a new browser window but....
ChromeOptions ops = new ChromeOptions();
ops.addArguments("--disable-notifications");
System.setProperty("webdriver.chrome.driver", "./lib/chromedriver");
driver = new ChromeDriver(ops);
...my Base class below already invokes a browser window:
@Override
@Parameters({"baseUrl","seleniumUrl", "browser"})
@BeforeMethod
public void onTestSetup(String baseUrl, String seleniumUrl, String browser, ITestContext ctx, Method method)
{
super.onTestSetup(baseUrl, seleniumUrl, browser, ctx, method);
settings = new Settings();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS);
homeob = PageFactory.initElements(driver, HomePgObj.class);
}
public synchronized void loginApp(String user, String pwd) throws InterruptedException
{
homeob = PageFactory.initElements(driver, HomePgObj.class);
homeob.login(user, pwd);
}
So the problem here using ChromeOptions opens up a second browser window. How can I solve this?