Param Sachdeva
Param Sachdeva

Reputation: 3

How to handle downloading popup alert, while downloading a file in chrome

Point 1. If I launched normal chrome driver without loading any profile then it would block all exe (keep/discard)

Point 2. When I provided my chrome profile, these are my observations:

  1. Clean exe downloading normally
  2. Download error exe giving same dialogue on chrome driver as normally on chrome browser
  3. Issue is here: those exe which are througing alert of keep/decline popup normally ...those are normally downloading on driver.

SNAPSHOT attached (https://i.sstatic.net/PtZ18.png)

I am loading chrome profile by this pattern

ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir="+userProfile);
options.addArguments("--start-maximized");
options.addArguments("test-type");              
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(options);   

So this is the main Issue

One more thing: Actually these popups are not html pages. These are over layer on chrome so any technique to spy those using any other free tool? or selenium?

Upvotes: 0

Views: 1596

Answers (1)

Enumy
Enumy

Reputation: 851

Try this maybe

((JavascriptExecutor) driver).executeScript("window.confirm = function(msg) { return true; }");

Upvotes: 1

Related Questions