Make Selenium Easy

Selenium Interview Question 11 – Which Class Implements Alert Interface in Selenium WebDriver?

As a part of Selenium Interview Questions series, in this post, we will see about Implement class of Alert interface.

Someone asked me this question and I felt this is good to share with others as well. So here is the post for the same.

Honestly, I was also not aware of this. So I started researching.

First I went to Alert interface Javadoc. I did not find any implemented class information there.

Then I looked at RemoteWebDriver Javadoc as it is concrete immediate class of WebDriver interface. There I got my answer.

There is an inner class named “RemoteAlert ” which implements Alert interface and define methods declared in Alert interface as shown above.

When we use switchTo().alert() method, it returns a reference of RemoteAlert class which is up cast to Alert interface.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappyLearning

You can find all Selenium related post here.
You can find all API manual and automation related posts here.
You can find frequently asked Java Programs here.

Table of Contents

Author: Amod Mahajan

A software Tester who is paid to judge products developed by others. Currently getting paid in American Dollars. Writing technical posts and creating YouTube videos are my hobbies.

2 thoughts on “Selenium Interview Question 11 – Which Class Implements Alert Interface in Selenium WebDriver?

Leave a Reply

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.