FileDownloader { public String imageDownloader(WebElement element) throws Exception { return downloader(element, "src"); } FileDownloader(WebDriver driverObject); String getDownloadPath(); void setDownloadPath(String filePath); String fileDownloader(WebElement element); String imageDownloader(WebElement element); String downloader(WebElement element, String attribute);  }
@Test public void downloadAnImage() throws Exception { FileDownloader downloadTestFile = new FileDownloader(driver); driver.get("http: WebElement image = driver.findElement(By.id("ebselenImage")); downloadTestFile.imageDownloader(image); }