How to handle browser level notification using Selenium Webdriver

前端 未结 6 2131
Happy的楠姐
Happy的楠姐 2020-12-17 22:03

I am Automating some test cases using Selenium Webdriver and core Java,in chrome browser for one test case on clicking button I am getting browser level notification \'Show

6条回答
  •  时光说笑
    2020-12-17 22:49

    WebDriver driver ;
            FirefoxProfile profile = new FirefoxProfile();
            profile.setPreference("permissions.default.desktop-notification", 1);
            DesiredCapabilities capabilities=DesiredCapabilities.firefox();
            capabilities.setCapability(FirefoxDriver.PROFILE, profile);
            driver = new FirefoxDriver(capabilities);
            driver.get("your Web site"); 
    

提交回复
热议问题