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。)单击链接(打开“下载多个文件”确认弹出)。
无法下载文件。
https://stackoverflow.com/questions/41356899
复制相似问题