How to close this dialog
This is the code for an opening specific page and after that popup appear which I am unable to handle.
I have used alert, switchTo, etc..
//Open Browser WebDriver driver = new ChromeDriver(); //Enter the URL driver.get("https://www.mariatash.com/"); //I Agree PopUp driver.findElement(By.xpath("//button[contains(text(),'I Agree')]")).click(); driver.findElement(By.xpath("//a[.='Appointments']")).click(); //after this, that popup appears and then its get stop.... u can find it in the image below
Suggest some way to close it.
I tried to close the dialog on that page with a CSS Selector named
.dialogClose, it works. You can use unique classes (
class="uniqueclassname anotherclassname") to find elements.
In your case, the following code should work:
Some issue I ran into when testing this on my machine: