I am using Selenium + Chromedriver to automate testing of a website. One of the functionalities uses Location Services. I have enabled the Location Service for the Chrome browser that I am using.
But when I run the test, the dialog pictured below shows.
The following code finds the alert - but the alert.dismiss() does not seem to work (i.e. the dialog is still present)
try {
Alert alert = driver.switchTo().alert();
alert.dismiss();
} catch (NoAlertPresentException ex) {
// System.out.println("No alert for this test case.");
}
How can the test code click the Allow button and have the dialog dismissed? My goal is to click Allow.
--Sam--