# Upload / Attach File

**URL:** <https://forum.katalon.com/t/upload-attach-file/93399>\
**Category:** Miscellaneous\
**Created:** [August 2, 2023, 8:11am UTC](https://forum.katalon.com/t/upload-attach-file/93399 "2023-08-02T08:11:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![noor.ahmed](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/noor.ahmed/32/22831_2.png) [@noor.ahmed](https://forum.katalon.com/u/noor.ahmed)\
**Post date:** [August 2, 2023, 8:11am UTC](https://forum.katalon.com/t/upload-attach-file/93399/1 "2023-08-02T08:11:06Z")

</div>

how to upload file ,  
I have option : when I click then mentioned screen will open, how to select image ?

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/e/d/ed8089d2f1fb1fef830260e1d04caf40170018b2.jpeg)

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [August 3, 2023, 5:27pm UTC](https://forum.katalon.com/t/upload-attach-file/93399/3 "2023-08-03T17:27:37Z")

</div>

There is the “upload” statement that you can try.

Example:  
WebUI.uploadFile(findTestObject(‘input\_browse’), ‘D:\test-photo.png’)

> **[\[WebUI\] Upload File | Katalon Docs](https://docs.katalon.com/docs/create-tests/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-upload-file)**
>
> Description

Additionally, you might be able to use the Robot to assist you.

```auto
import java.awt.Robot
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.awt.event.KeyEvent

StringSelection ss = new StringSelection('pathway to file.txt');
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);

Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);

WebUI.waitForPageLoad(10)

```

---

<div class="post-metadata">

**Author:** ![Dave\_Evers](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dave_evers/32/435_2.png) [@Dave\_Evers](https://forum.katalon.com/u/Dave_Evers)\
**Post date:** [August 6, 2023, 7:35am UTC](https://forum.katalon.com/t/upload-attach-file/93399/4 "2023-08-06T07:35:57Z")

</div>

Hi @noor.ahmed, This could help too: [How-to use ‘sendKeys’ or 'File Upload' to upload files](http://forum.katalon.com/t/how-to-use-sendkeys-or-file-upload-to-upload-files/54758/1)
