How to Upload a file from windows explorer

@Hassan ShafiqI ended up just creating an autoIT file to pass this in. I could not get Katalon to recognize the native explorer window. It works flawlessly now. My little blurb looks like this:

//Click the Browse for file button…
WebUI.click(findTestObject(‘Page_SubmitJob/label_BrowseForFile’))
//Sleep to wait for window to open.
Thread.sleep(1000)
//Load up the autoIT script using the first variable specified.
autoit_prj = ‘C:\\insertVariableExplorerWindow.exe \“C:\\Filename.ext\”’
//Run the autoIT script.
Runtime.getRuntime().exec(autoit_prj)

The autoIT looks like:
ControlSetText("","","",$CmdLine[1])
Send("{ENTER}")

So it takes the first variable I am passing above which is the path and filename to upload and then it hits ENTER to get rid of the window.

1 Like