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.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s