Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.7k points)

I'm trying to login to Facebook. After a successful login, I get a browser popup:

Show Notifications

How with the webdriver can I click Allow and proceed forward?

1 Answer

0 votes
by (62.9k points)

Create an instance of ChromeOptions class

ChromeOptions options = new ChromeOptions();

Then Add chrome switch to disable notification - "--disable-notifications"

options.addArguments("--disable-notifications");

After that set path for driver exe

System.setProperty("webdriver.chrome.driver","path/to/driver/exe");

and then pass ChromeOptions instance to ChromeDriver Constructor

WebDriver driver =new ChromeDriver(options);

If you wish to Learn Selenium visit this Selenium Webdriver Tutorial and Selenium Webdriver Interview Questions by Intellipaat.

To learn in-depth about Selenium, sign up for an industry based Selenium certification.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...