首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用selenium webdriver (JAVA)处理chrome中弹出的“下载多个文件”确认消息?

如何使用selenium webdriver (JAVA)处理chrome中弹出的“下载多个文件”确认消息?
EN

Stack Overflow用户
提问于 2016-12-28 14:57:13
回答 0查看 3.2K关注 0票数 0

View image of description...

代码语言:javascript
运行
复制
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...");

    }

步骤:

1.)在大小下拉列表2中选择选项1。)单击链接(单击文件从服务器下载后) 3.)在大小下拉列表4中选择选项2。)单击链接(打开“下载多个文件”确认弹出)。

无法下载文件。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41356899

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档