Upload File Keyword Not Recorded

Hello everyone!

I’m still a newbie using Katalon, i’m trying to record a script to upload an image, however when i record it, it doesn’t record when i upload the file, instead it only records that part where i press the upload image button.

Below is the script after i finished recording:
WebUI.openBrowser(‘’)

WebUI.navigateToUrl(‘****’)

WebUI.setText(findTestObject(‘Object Repository/Page_Workay Admin Login/input_Username_username’), ‘****’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page_Workay Admin Login/input_Password_password’), ‘Zl2WZ9ufM7Ggyu1gmP0hRDAdkJHQ0dOi’)

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Login/button_Login’))

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Home/p_Reward’))

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Brands Reward/div_Add new brand’))

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Add Brand/label_Upload logo brand’))

I have tried manually adding the upload file keyword, resulting into this:
WebUI.openBrowser(‘’)

WebUI.navigateToUrl(‘****’)

WebUI.setText(findTestObject(‘Object Repository/Page_Workay Admin Login/input_Username_username’), ‘****’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page_Workay Admin Login/input_Password_password’), ‘Zl2WZ9ufM7Ggyu1gmP0hRDAdkJHQ0dOi’)

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Login/button_Login’))

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Home/p_Reward’))

WebUI.click(findTestObject(‘Object Repository/Page_Workay Admin Brands Reward/div_Add new brand’))

WebUI.waitForElementClickable(findTestObject(‘Page_Workay Admin Add Brand/label_Upload logo brand’), 3)

WebUI.uploadFile(findTestObject(‘Object Repository/Page_Workay Admin Add Brand/label_Upload logo brand’), ‘C:\Users\Armand\Pictures\1067981407.jpg’)

However, it gives back an error stating:
=============== ROOT CAUSE =====================
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
At object: ‘Object Repository/Page_Workay Admin Add Brand/label_Upload logo brand’

Any help would be appreciated, thank you!

Hi,

It seems like you have not granted the permission for the photo to be able to upload. Please grant all permissions.

Possibly the Test Object has a wrong locator. It points to an element which you do not intend to. You need to correct the Test Object. You can manually edit the Test Objects after generation. You can correct the locator (possibly XPath expression).

The recorder tool is helpful, but not complete. It sometimes does not obey you.

You should not keep yourself away from manually correcting the generarted Test Objects. You can manually fix any mistakes if you know the XPath technology enough.

If you don’t know XPath at all, then read the following to learn it:

Just so you know, that you are not using Katalon Recorder as your heading states, but Katalon Studio and the Web Recorder or Web Spy. You can tell because of the coding. Katalon Recorder is a total separate application. The below gives an example of KR.

After you have used the recorder to get a start on your test, then you should go in and “improve” the repeatability of your test. As an example, with the below statement you can add:

WebUI.navigateToUrl('****')
WebUI.waitForPageLoad(10)  // or 5 or ???

Similarly goes for:

WebUI.click(findTestObject('Object Repository/Page_Workay Admin Login/button_Logi'))
WebUI.waitForPageLoad(10)

You did add the waitForElementClickable() so just a bit more of that.

1 Like

I changed the “Product Forum” associated to this topic from “Katalon Recorder” to “Katalon Studio”.

I would have to second @kazurayam’s concern that you have the wrong element. You say upload to “image button” but your object says “label”. Probably why it is not interactable. Again, you can ‘Drag and Drop’ your replacement element(s) from the Object Repository into your Test Case to replace your existing “label” reference.