How to disable pop up and alert windows in Firefox browser using Selenium?

0 votes
How to disable pop up and alert windows in Firefox browser using Selenium?
May 20 in Selenium by Ranjan
32 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hey Ranjan, you can use these lines of code to disable a popup or alert window in Firefox browser using Selenium. There is a preference called dom.disable_beforeunload. You should change its value to true. With Selenium, you can create a new customized Firefox profile:

import org.openqa.selenium.chrome.FirefoxDriver;

import org.openqa.selenium.chrome.Preferences;

FirefoxProfile customProfile = new FirefoxProfile();

customProfile.setPreference("dom.disable_beforeunload", true);

FirefoxDriver driver = new FirefoxDriver(customProfile);
answered May 21 by Abha
• 8,450 points

Related Questions In Selenium

0 votes
1 answer

How to handle Pop-up in Selenium WebDriver using Java

Actually, its pretty simple. Use this code ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
2,778 views
0 votes
1 answer

How to switch between two windows in browser using Selenium java

Yes, this is possible. First, you need ...READ MORE

answered Sep 25, 2018 in Selenium by Meci Matt
• 9,400 points
1,670 views
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
5,013 views
0 votes
1 answer

How to Check if any alert exists in selenium using Python

This might work for you. It did ...READ MORE

answered May 10, 2018 in Selenium by king_kenny
• 3,590 points
2,621 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
138 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
528 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
131 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.