Question: In my website there is provision for deleting say address entry from an account.
When I'm clicking on "Delete an address" link it asks me to confirm delete with pop up window which is having two buttons- "OK" and "Cancel". I got stuck here b'coz this pop window is not inspect-able by right clicking of a mouse,

Please let me know if anyone is having solution for this.
Thanks in advance

Answer: 
Webdriver provides two in-built methods to deal with alerts. Sample code snippets are written below:

```
Webdriver driver = new FirefoxDriver();
// To accept the alert (Clicking on the 'OK' button)
driver.switchTo().alert().accept();
// To dismiss the alert (Clicking on the 'Cancel' button)
driver.switchTo().alert().dismiss();

```
In my case following was worked:

```
driver.switchTo().alert().accept()

driver.switchTo().alert().dismiss()

```