How to disbale javacript alert in chrome browser | Selenium Webdriver Tutorial with c# |Selenium C# training

Selenium C# Training Forum

How to disbale javacript alert in chrome browser

V
Vikas S Post on 04/03/2019

Hi Gunjan,

 

I just googled regarding above mentioned question. So i am not able to find suitable answer anywhere please help me regarding how to disable the javscript alert in chrome browser. please find the attached screenshot.

G

Instructor

gunjan Reply on 05/03/2019

This is a web notification. Try handling it with ChromeOptions class

ChromeOptions options= new ChromeOptions();

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

IWebDriver driver=new ChromeDriver(options);

V
Vikas S Reply on 05/03/2019

Ok thanks Gunjan.