19 November, 2014

Alerts in Selenium Web-driver.

There are 2 types of alerts in selenium web-driver.
  1. Web based alerts
  2. Windows based alerts
1.Web based alerts are handled by selenium but selenium cannot handle windows based alerts.
2. Selenium uses third party tool to handle windows based alerts.
3. They are Autoit, Sikuli, Robot class.
4. In selenium web-driver the web based alerts are handled by below methods.

  • void accept( ) - It clicks on OK button.
  • void dismiss( ) - It click on Cancel button.
  • String getText( ) - It returns text written on the web alert.
  • void sendKeys( )- It sends data into web alert.

No comments:

Post a Comment