Upload File Issue

Hi.

I have pop-up window for file upload. And I need to upload document on system.

When I use File Upload action in Katalon, how I need to describe my Object? If I create object according to my Pop-UP window frame ID, is pass the step but still do not up load file. If I use ID if ''Choose File" button it doest not work.
So I can not upload file on system

image.png

Upload file. jpg.jpg

I am facing exactly the same issue. Did you get any update on this?

1 Like
Good Morning!Instead of putting "\" put "\\"

Yan Reis said:

Good Morning!Instead of putting "\" put "\\"

That automatically changes to \\ in script mode. Dont think that’s the problem we are facing.

You can handle file chooser dialog windows with AutoIT scripting: https://www.autoitscript.com/site/ It generates a simple exe file, which you can execute from Katalon test case.

I found the solution on the other forum post :slight_smile: yay! thank you guys

1 Like

I’m trying to upload a file but faced error of Object is null.
Please help, need advice.

My script

WebUI.openBrowser(‘C:\\\Users\\\yl.tey\\\Desktop\\\Engagement\\\Campaign Image\\\Image for testing’)

WebUI.maximizeWindow()

WebUI.uploadFile(findTestObject(‘Upload File’), ‘C:\\\Users\\\yl.tey\\\Desktop\\\Engagement\\\Campaign Image\\\Image for testing\\\Clinique.png’)

FilePath = WebUI.getAttribute(findTestObject(‘Upload File’), ‘value’)

My error

Test Cases/Client Portal/Campaign/Create New Campaign- Add Activity(Voucher Standard) FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Unable to upload file ‘C:\Users\yl.tey\Desktop\Engagement\BOLD.Tag\Campaign Image\Image for testing\Clinique.png’ to object (Root cause: java.lang.IllegalArgumentException: Object is null)

at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)

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:53)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.uploadFile(WebUiBuiltInKeywords.groovy:2945)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$uploadFile$6.call(Unknown Source)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)

at Script1540364142848.run(Script1540364142848.groovy:61)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)

at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)

at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:200)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:99)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:90)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:149)

at TempTestCase1540370245940.run(TempTestCase1540370245940.groovy:22)

at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:263)

at groovy.lang.GroovyShell.run(GroovyShell.java:518)

at groovy.lang.GroovyShell.run(GroovyShell.java:507)

at groovy.ui.GroovyMain.processOnce(GroovyMain.java:653)

at groovy.ui.GroovyMain.run(GroovyMain.java:384)

at groovy.ui.GroovyMain.process(GroovyMain.java:370)

at groovy.ui.GroovyMain.processArgs(GroovyMain.java:129)

at groovy.ui.GroovyMain.main(GroovyMain.java:109)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)

at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)

)

Test Cases/Client Portal/Campaign/Create New Campaign- Add Activity(Voucher Standard).run:61

@yaa lian : Could you please show site or similar?

which post is that?

HI,

Can you share the solution please?

This might work for you…