# How to Upload a file from file from explorer

**URL:** <https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243>\
**Category:** AI & Agentic Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [February 16, 2024, 9:15pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243 "2024-02-16T21:15:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![naomy.arnold](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/naomy.arnold/32/24883_2.png) [@naomy.arnold](https://forum.katalon.com/u/naomy.arnold)\
**Post date:** [February 16, 2024, 9:15pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/1 "2024-02-16T21:15:49Z")

</div>

Hello, How is everyone?  
yes I read a couple documents in the community about this and still not understanding how to do it. The articles are also out dates, so I wanted to see if there is anything else I can do.

**WHAT:**  
How do I upload a form from file explorer ( could be headless if needed also)

**When** I click this button the “ADD Policy” button below

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/f/8ff0a22891ead576efd42ca39ae5d0d9a12514d5.png)

* * *

The **file explorer window** appears

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/b/e/be50bf607e1291c5418931951f6238162ec5d9c1.png)

I want the code to “ **enter the file path of the file in file explorer** ”: URL which is _c: drive_

or can I add it to desktop? which ever is easier.

**File type: PDF**

I need to double click it in order for it to be added to the website.

* * *

It will be added here once I click it in file explorer

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/1/e/1e9e02e5f2929f5e57c6e3306d629e1b8f26c19b.png)

When I use the web recorder of course it does not interact with my local PC.

Also its NOT an INPUT BOX so I cant write a code like this **WebUI.uploadFile(findTestObject(‘input\_browse’), ‘D:\test-photo.png’)…**

Do I need to download any other tool to get this to happen.

---

<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:** [February 16, 2024, 9:20pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/2 "2024-02-16T21:20:18Z")

</div>

The below link might assist you.

> [@How to use the 'Robot Framework' to load files using a custom keyword](http://forum.katalon.com/t/how-to-use-the-robot-framework-to-load-files-using-a-custom-keyword/24108):
>
> Please Note: Best practices is to NOT to use WebUI.delay() OR Thread.sleep() but sometimes there is no alternative. First create a new ‘uploadFiles’ custom keyword as follows: -Start ‘Katalon Studio’ -Open any test project -Click ‘File’ \> ‘New’ \> ‘Keyword’ -Input ‘Package’= tools -Input 'Class Name" = uploadFiles -Click ‘OK’ -Result: A new ‘uploadFiles.groovy’ custom keyword is created Copy and paste the following code to the new custom keyword: //Use "CTRL+SHIFT+O" to add any require…

Edit: Does your pathway have double slashes in it? It needs them. (A single slash is an escape character, like for the “new line”, `\n`, or “tab”, `\t`, so the second slash says that the first slash is just a slash.)

```auto
gImportFileName = 'G:\\Katalon Test Cases\\KatalonCASE\\Data Files\\Details.txt';

```

---

<div class="post-metadata">

**Author:** ![Dan\_Bown](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dan_bown/32/20464_2.png) [@Dan\_Bown](https://forum.katalon.com/u/Dan_Bown)\
**Post date:** [February 20, 2024, 7:47pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/3 "2024-02-20T19:47:49Z")

</div>

Could you doublecheck that there isnt an input field? Search for //input in dev tools maybe? I’ve tested a page where the input field was not that close to the button in the DOM

---

<div class="post-metadata">

**Author:** ![naomy.arnold](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/naomy.arnold/32/24883_2.png) [@naomy.arnold](https://forum.katalon.com/u/naomy.arnold)\
**Post date:** [February 20, 2024, 9:11pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/4 "2024-02-20T21:11:29Z")

</div>

![image](https://europe1.discourse-cdn.com/katalon/original/3X/6/a/6a5ba1e66f71808b6621fbb05bc370ce78eed690.png)

-------------If I add a doc manually

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/3/9/39afcd2c11804228dcc921a8a9f29d630c407bf0.png)

@Dan_Bown

---

<div class="post-metadata">

**Author:** ![Dan\_Bown](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dan_bown/32/20464_2.png) [@Dan\_Bown](https://forum.katalon.com/u/Dan_Bown)\
**Post date:** [February 21, 2024, 12:07am UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/5 "2024-02-21T00:07:41Z")

</div>

I think you can use the Katalon keyword in this case - it requires an input of type = file, which is what you have shown above. There are alternatives but this is the out-of-box solution:

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

Create a test object for the input eg

> //input[@type,‘file’]

then update the filepath as required (remembering the double slashes).

The keyword doc is suitable for this case I think (there are several alternatives on the forum as well):

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

---

<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:** [February 21, 2024, 2:55am UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/6 "2024-02-21T02:55:58Z")

</div>

Hi @naomy.arnold, See this post: [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)

---

<div class="post-metadata">

**Author:** ![naomy.arnold](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/naomy.arnold/32/24883_2.png) [@naomy.arnold](https://forum.katalon.com/u/naomy.arnold)\
**Post date:** [February 23, 2024, 10:10pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/7 "2024-02-23T22:10:47Z")

</div>

Ok I will try next week. Sorry i didnt respond sooner, I been in meetings.

---

<div class="post-metadata">

**Author:** ![naomy.arnold](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/naomy.arnold/32/24883_2.png) [@naomy.arnold](https://forum.katalon.com/u/naomy.arnold)\
**Post date:** [February 27, 2024, 1:20pm UTC](https://forum.katalon.com/t/how-to-upload-a-file-from-file-from-explorer/120243/8 "2024-02-27T13:20:24Z")

</div>

Dev team is working on making it an input field. I could not get it to work.
