0

View image of description...

for (int i = 0; i < getOptions.size(); i++) {
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        Thread.sleep(2000);
        System.out.println("Select Options Name: " + getOptions.get(i).getText());
        Select selctValue = new Select(
                driver.findElement(By.xpath("//ul/li[1]/div[@class='input-slect-fix-w']/select")));
        selctValue.selectByIndex(i); // Size Drop down 
        Thread.sleep(5000);
        log.info("Click on download templates link.");
        WebDriverWait wait = new WebDriverWait(driver, 30);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("swtemplates")));
        wf.clickOnLink(By.id("swtemplates")); // Download link 
        Thread.sleep(5000);
        String getTitleOnPage = new String(driver.getTitle());
        Assert.assertFalse(getTitleOnPage.matches("(.*)404(.*)"), "Failed download templates...");

    }

Steps:

1.) Select option 1 in Size drop down 2.) Click on link (After click file download from server) 3.) Select option 2 in Size drop down 4.) Click on link (Open "Download multiple files" confirmation pop up.)

File does not download.

1 Answers1

0

Try https://stackoverflow.com/a/36821119/8731685 solution. it worked for me. Below line of chrome preferences removed the multiple download dialogue box and downloaded all the files.

chromePrefs.put("profile.content_settings.exceptions.automatic_downloads.*.setting", 1 );