How to Upload a file from windows explorer

Hello @emine !
Thanks for imformation. Problem is here, that I try to call this custom keyword from another custom keyword. Both keywords are in the same package.

Hello @plaidshirtakos
please , see below in link :

I also have more than one custom keyword definition in the same package. Please see the picture below.

When I add a custom keyword during the Test Case, they both appear

1 Like

@emine : I see, but you call it from a testcase. I call one of my custom keywords from a testcase, which should call another custom keyword.


I’m sorry but I didn’t quite understand.

@emine : I marked order of method calls. So as I mentioned, I has to call custom keyword from another custom keyword.


@emine : I try something ike this: How to use @Keyword in other file

@emine : Could you please share your sample project to try it on my side?

hello @plaidshirtakos
As I have shown in the visual, I have 2 functions in a single custom keyword.

Hi Friends,

Thanks in Advance

In my scenario: i need to upload a TXT file Through Windows Dialogue box .Auto IT Feature is not allowed in my Organization.

Can’t we upload without Auto IT.???

if so ,kindly suggest the code to keyin the file path into the windows dialogue box .

Scenario 2:If the Above Scenario Works, can we give path of the txt file from Excel File also…???

if it is yes …kindly suggest the way or code .


with Regards,

hello @mikkili.rahul.tej
The following spelling will be useful.

You can also pull the file path from excel.

CustomKeywords. 'dosya.dosyayukleme.uploadFile(findTestObject(testobject),C: \ Users \ Desktop \ test data file )

In the test case step, you can point to the parameter in the excel data instead of the local file path as the second parameter.

First, create an excel locally and write the path information of the test file to txt and save it.

In the second step, as you can see in the screenshot, include this file in your Katalon project.

Finally, instead of directly typing the file path where you call custom keyword, you should pull it from excel.

CustomKeywords.‘dosya.dosyayukleme.uploadFile’(findTestObject(testobject), findTestData(‘New Test Data’).getValue(1, 1) )

Hi Emine,

Thanq for the Response …

In my Scenario:I am using Iterations …as My data is 50 Rows in Excel and Each row will be having one TXT file .

Does ur Scenario Works for this design…??

Note:I am Already calling my excel data sheet from local drive.


With Regards,
Mikky .

Hi, the scenario works for txt file.

Hi Emine,

i repeat my question once again

Iteration 1:Will open application and upload the file and close the Application and this process will repeat for 5 iterations…

does ur scenario help me on the above 5 iterations iterations…??


With Regards,

Hello , In the application you can find the solution using the custom keyword u for 5 times.
The keyword we create allows you to upload any file on your computer to the corresponding area.
This process will automatically select and load the file from the windows popup.

Hi Emine,

I had stucked at step 1 only .The Test object is having issue …i cannot able to click on the specific object .

the object is in IFrame and object is hidden . i had tried in many ways but all in Vain .

Without Test object can we able to try ur code …?? if Yes can u guide me …


With Regards,

hello @mikkili.rahul.tej

In the recording phase of the test, it will be added to the object repostory folder by right-clicking it.
Then use this object path and file url for the custom keyword.

Tried Emine …cannot able to click on the object .

Issue :need to click on upload object but object property cannot click exactly over their .it s doing operation on entire thts why cannot able to get window popup

object is in the IFrame .

Refer to the screen shot attached for image and object properties .


With Regards,
Mikky …!!


def uploadFile2 (TestObject to, String filePath , String file , String file2) {
StringSelection ss = new StringSelection("""+filePath+"" " +"""+ file +"" "+ file2 );
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
Robot robot = new Robot();

Hello Again @mikkili.rahul.tej
Then remove the object click from the Keyword code and try again.
Of the above codes, I’m marking bold ones related to object clicks. Wipe them off the code. Recall Keyword and try.

Hi Emine,

thank you for the code …that works for me without using Test Object .

now when i am trying your code to give the Path from Excel.its not working .i had followed your steps from the above responses.

My code:

Your Code

CustomKeywords.‘dosya.dosyayukleme.uploadFile’(findTestObject(testobject), findTestData(‘New Test Data’).getValue(1, 1) )

Attached the screen shot for your reference


With Regards,


Remove the quote