Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...