Selenium WebDriver : How to Handle JavaScript Alerts and Prompts

Selenium 2 provides Alerts API, to work on pop & alert window –
// Get a handle to the open alert, prompt or confirmation
Alert alert = driver.switchTo().alert();
// Get the text of the alert or prompt
// And acknowledge the alert (equivalent to clicking “OK”)


Popular posts from this blog

Testing Webservice with SoapUI Having Windows Authentication

Data Driven Testing Using Selenium -WebDriver in Python

How to Re-run Failed Scenarios in Cucumber