Hello everyone,
So many people has asked about this question and I am going to repeat that because there is no fair answer. When I want to navigate a url , sometimes I am able to see “wants to send notifications , block or allow” pop up message. And what is the solution of this . I could not click any item without click on allow or block.
Thanks
@Zarashima @Chris_Trevarthen I believe that you can help
hello,
which browser in use?
with Webdriver maybe you can prevent this pop up
public WebDriver setChromeOptions(File folder){
ChromeOptions options = new ChromeOptions();
String downloadPath = folder.getAbsolutePath()
//String downloadsPath = System.getProperty("user.home") + "/Downloads";
println ("downloadpath "+downloadPath)
Map<String, Object> chromePrefs = new HashMap<String, Object>()
chromePrefs.put("profile.default_content_settings.popups", 0);
chromePrefs.put("download.default_directory", downloadPath)
chromePrefs.put("download.prompt_for_download", false)
chromePrefs.put("plugins.plugins_disabled", "Chrome PDF Viewer");
options.addArguments("--headless")
options.addArguments("--window-size=1920,1080")
options.addArguments("--test-type")
options.addArguments("--disable-gpu")
options.addArguments("--no-sandbox")
options.addArguments("--disable-dev-shm-usage")
options.addArguments("--disable-software-rasterizer")
options.addArguments("--disable-popup-blocking")
options.addArguments("--disable-extensions")
options.setExperimentalOption("prefs", chromePrefs)
DesiredCapabilities cap = DesiredCapabilities.chrome()
cap.setCapability(ChromeOptions.CAPABILITY, options)
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
System.setProperty("webdriver.chrome.driver", DriverFactory.getChromeDriverPath())
//System.setProperty("webdriver.chrome.driver", "C:\\Users\\timok1\\Desktop\\chromedriver\\chromedriver.exe")
WebDriver driver = new ChromeDriver(cap);
return driver
}
Hi,
I am using Chrome, thank you