# Downloading images from a web address

**URL:** <https://forum.katalon.com/t/downloading-images-from-a-web-address/15811>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [December 20, 2018, 2:52pm UTC](https://forum.katalon.com/t/downloading-images-from-a-web-address/15811 "2018-12-20T14:52:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Marek\_Melocik](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/marek_melocik/32/371_2.png) [@Marek\_Melocik](https://forum.katalon.com/u/Marek_Melocik)\
**Post date:** [December 20, 2018, 3:45pm UTC](https://forum.katalon.com/t/downloading-images-from-a-web-address/15811/4 "2018-12-20T15:45:11Z")

</div>

Other solution: _This code downloads only an image, not whole screen._

```
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import org.openqa.selenium.By
import org.openqa.selenium.WebElement
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
    
WebUI.openBrowser("https://d1h3p5fzmizjvp.cloudfront.net/themes/katalon_4/images/katalon_template_1809/logo@2x.png")
WebElement image = DriverFactory.getWebDriver().findElement(By.xpath("//img"))
String imgSrc = image.getAttribute("src")

URL imageURL = new URL(imgSrc)
BufferedImage saveImage = ImageIO.read(imageURL)

ImageIO.write(saveImage, "png", new File("C:\\test\\test-image.png"))

```

_edit: imports added_

---

_[View the full topic](https://forum.katalon.com/t/downloading-images-from-a-web-address/15811)._
