Issue with webui.uploadfile

Hello,

I try to upload file (load list of contact)


in this screen

in the log the step is successful but in the screen the systeme dialog box is open

whithout the filepath

I tried many solution from the docs without results…

katalon 10.0
firefox 128.3.1esr (64 bits)

hi @adecaest

uploadFile does not click anything, it only does sendKeys of the path into an input type=“file”. if the test object you pass is the visible “load list” button (that is what the recorder captures, because that is what you clicked), katalon ends up clicking a normal button, the os dialog opens, and the step is still “passed”. so the object is the problem, not the keyword.

inspect the page and look for the real file input, usually hidden right next to the button:

xpath=//input[@type='file']

make a test object with that and call uploadFile on it. on firefox a display:none input refuses sendKeys, so if it still fails, unhide it first:

WebUI.executeJavaScript("document.querySelector('input[type=file]').style.display='block'", null)
WebUI.uploadFile(findTestObject('Contacts/input_file'), 'C:\\\\data\\\\contacts.csv')

and if the dialog from your screenshot is already open from a previous attempt, close it before the run, firefox is stuck until it is gone.