I am trying to get rif od an alert as displayed in the image:
This alert can be easily dismmised by pressing escape or return keys. But I cannot get it done using selenium.
First, I am switching to the window using:
m_parentWindowHandler = m_chromeWebdriver.getWindowHandle();
.
.
.
m_chromeWebdriver.switchTo().window(m_parentWindowHandler);
Then I tried
Actions action = new Actions(m_chromeWebdriver);
action.sendKeys(Keys.RETURN).build().perform();
(also with Keys.ESCAPE)