0 votes
1 view
in DevOps and Agile by (19.8k 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 (63.4k 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 !


Categories

...