Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Handling Website Popups In Selenium webdriver

Posted on 02/19/2025 By admin

Hello Folks,

I will start series of posts on topic “Handling different types of popup in selenium webdriver”.

What is a popup?

  • A popup is a window/dialog box/alert which appears when you perform some action such as click, load a URL etc.
  • A popup can appear from website, browser and windows.
  • Popup is way of getting/show some information to user such as confirmation, notification etc.

Website Popup:

  • When we open MakeSeleniumEasy URL, you see a dialog boxes within browser asking to subscribe to get post notifications. This type of dialog boxes are generated from website when you load its URL. This is called popup/dialog box generated by URL.
  • You can inspect this popup as you inspect any normal web element.
  • Generally this popup is build using tag.
  • You just need to inspect fields on popup (Email and name is below example) and you can type texts.
  • There is no need of using Alert interface to handle this popup. If you try to use Alert interface to handle this popup, you will get exception NoAlertPresentException.
  • Remember the important point, if you can inspect any popup, you can handle that as you handle any other web element such as text box in selenium webdriver.
  • It has a close button and you can close this popup without performing any action on it.
  • You can not block this popup using popup blocker option of browsers.

Java code:

Output:
You can run above program and check. It will print header of pop up and enter details in text boxes.

You can notice, there was no need of any extra knowledge. Just remember, every popup does not require Alert interface to handle it.

Example 2:

When you open TimesOfIndia URL, you are asked for enable new notifications in a popup. You can inspect this and handle it like as a normal button. Try it for better understanding.

We will see other types of popups in upcoming posts.

If you have any doubt, feel free to comment below.

If you like my posts, please like, comment, share and subscribe.

#ThanksForReading

#HappySelenium

Uncategorized

Post navigation

Previous Post: Postman Tutorial Part 11 – Sending DELETE Request in Postman
Next Post: Handling Frames/IFrames In Selenium WebDriver : Part 1

Related Posts

Implementation of Explicit Wait as FluentWait and WebDriverWait in Selenium WebDriver Uncategorized
JVMWindows – Make Selenium Easy Uncategorized
REST Assured Tutorial 56 – JSON Schema Validation Without Rest Assured Uncategorized
JSON with JSONPath Uncategorized
Interview Experience at CTS (Cognizant) Bangalore for Selenium Java Profile ( Sep – 2019) Uncategorized
February 13, 2018 – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark