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.

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.

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

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

Leave a Reply