Whereas browsing the web, everybody will need to have come throughout so many web sites who sends notifications. These notifications may be on a desktop or machine even when that net web page isn’t open in our browser.
Typically, we name them net push notifications. Under is the screenshot of notifications from the Google Chrome browser:-

On the aspect be aware, we want to point out about WooCommerce Push Notification plugin that we’ve developed permitting retailers to ship customized push notifications to susbsribers.
Step-by-step execution of Code:-
We’ve got to comply with the below-mentioned steps to deal with these notifications:-
1: Create an occasion of ChromeOptions class
ChromeOptions choices = new ChromeOptions();
2: Add chrome swap to disable notification – “–disable-notifications”
choices.addArguments("--disable-notifications");
3: Set path for the chrome driver
System.setProperty("webdriver.chrome.driver", "/residence/customers/garima.pathak/Desktop/softwares/chromedriver");
4: Cross ChromeOptions occasion to ChromeDriver Constructor
WebDriver driver =new ChromeDriver(choices);
5: Give the navigation of the web page on which we need to deal with the notifications.
driver.get("http://wordpressdemo.webkul.com/wordpress-latest-tweets/");
Code:-
The whole code will appear like this:-
package deal automationFramework; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; public class Notifications { public static void predominant(String[] args) { ChromeOptions choices = new ChromeOptions(); choices.addArguments("--disable-notifications"); System.setProperty("webdriver.chrome.driver", "/residence/customers/garima.pathak/Desktop/softwares/chromedriver"); WebDriver driver =new ChromeDriver(choices); driver.get("http://wordpressdemo.webkul.com/wordpress-latest-tweets/"); driver.handle().window().maximize(); } }
That’s all about dealing with the notifications utilizing Selenium. Thanks for studying this weblog 🙂
As an official WooCommerce plugin vendor, we’ve developed many alternative plugins so as to add extra options, functionalities, and new integrations into the WooCommerce platform. One of the well-liked plugin is WooCommerce Market, that permits third-party sellers to promote their merchandise on the identical WordPress web site platform.