Issue with Asset upload

When upload the asset, pop up window with Next button appears, On click of Next button (Upload window appears to select the file), but while executing script fail on Next button.

com.kms.katalon.core.exception.StepFailedException: Unable to upload file ‘E:\Katalon\OldVersion\pxp\PXP_19.1.2\Object Repository\Images\Daytona’ to object ‘Object Repository/AssetUpload/span_Next’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.UploadFileKeyword.uploadFile(UploadFileKeyword.groovy:87)
at com.kms.katalon.core.webui.keyword.builtin.UploadFileKeyword.execute(UploadFileKeyword.groovy:68)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.uploadFile(WebUiBuiltInKeywords.groovy:2945)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$uploadFile$5.call(Unknown Source)
at 9. Asset Upload.run(9. Asset Upload:54)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1573469019580.run(TempTestCase1573469019580.groovy:21)
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
(Session info: chrome=76.0.3809.87)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DP048’, ip: ‘192.168.135.48’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 76.0.3809.87, chrome: {chromedriverVersion: 76.0.3809.68 (420c9498db8ce…, userDataDir: C:\Users\ASHISH~1.GOY\AppDa…}, goog:chromeOptions: {debuggerAddress: localhost:58296}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 9029704dad8808966fbcef4f8047b047
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:20)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:106)
at com.kms.katalon.core.webui.keyword.builtin.UploadFileKeyword$_uploadFile_closure1.doCall(UploadFileKeyword.groovy:80)
at com.kms.katalon.core.webui.keyword.builtin.UploadFileKeyword$_uploadFile_closure1.call(UploadFileKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)

This means the element is present but it is not ready to handle events (like click). Try waiting until it’s clickable:

https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-clickable.html

Hello,

We tried using this method still we getting same error.

Hi @pawan.singh

is the error message still the same ? Can you post the relevant HTML surrounding that next button ? Please post the script you’re using.

Hi,

WebUI.maximizeWindow()

WebUI.setText(findTestObject(‘Object Repository/AssetUpload/input_Username_userNameField’), ‘admin’)

WebUI.click(findTestObject(‘Object Repository/AssetUpload/button_Next’))

WebUI.setEncryptedText(findTestObject(‘Object Repository/AssetUpload/input_Password_userPasswordField’),
‘r98I3Krbh9GKMuVCU6OqlA==’)

WebUI.click(findTestObject(‘Object Repository/AssetUpload/button_Log In’))

WebUI.click(findTestObject(‘Object Repository/AssetUpload/div_Asset’))

WebUI.click(findTestObject(‘Object Repository/AssetUpload/div_Create_toolbarItemNew assetBulkUpload’))

WebUI.click(findTestObject(‘Object Repository/AssetUpload/div_Nothing is selected’))

WebUI.setText(findTestObject(‘Object Repository/AssetUpload/input_Select Class_multiSearchInputBox’), ‘image’)

WebUI.click(findTestObject(‘Object Repository/AssetUpload/div_Image_1’))

//WebUI.click(findTestObject(‘Object Repository/AssetUpload/span_Next’))

Thread.sleep(5000)

WebUI.uploadFile(findTestObject(‘Object Repository/AssetUpload/span_Next’), ‘E:\Katalon\OldVersion\Object Repository\Images\Daytona’)

WebUI.closeBrowser()

If you uncomment this step, then would it pass ? Also, the documentation of UploadFile keyword states that it only works on an input with type=file
https://docs.katalon.com/katalon-studio/docs/webui-upload-file.html#example-

On Chrome, please right-click on the span and then choose Inspect, an inspection tool would appear, please post the screenshot of that here so that we can verify it it’s the right element to use the keyword on.

See [How To] Use The Browser Developer Tools (F12 DevTools)

@ThanhTo,

For execution I am using Firefox ESR version 52.3.0. Particular to this revision, Upload event is not working but when executed same on latest Firefox version is working.

Our client is using Firefox ESR version 52.3.0.

Hi @pawan.singh

Does the upload file test step pass or fail in that particular version ? Please provide screenshots of the relevant HTML of the element and the test script. Did you execute the same script on different versions and confirm that the script works fine on the latest version ?