Upload file in a test case

It says that element is not found. That’s weird, according source code you provided it should be there. Can you doublecheck it?

all worked. the object needs to be an input type and we have data test marker setup by our dev team.

thanks for your help . this is closed.

@waiki i am also unable to run the upload file test case…can you please share in details how it was resolved.

check with you dev how the test object is defined. you have to set the test object with the proper settings.
you need to set this up in the test object if your developer has done so

then use this webUI statement.

WebUI.uploadFile(findTestObject(‘RubiconPCPHome/label_or Select files’), ‘////Users/path/x.png’)

this is my upload file html and webpage i am trying to execute for upload and it is giving me errors…can you check

Check my object setting as well

@waiki i have attached the screenshots and also copying my script, please take a look and let me know where i am doing it wrong.

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://www.convert-jpg-to-pdf.net/’)

WebUI.click(findTestObject(‘Object Repository/Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’))

WebUI.delay(2)

WebUI.waitForElementAttributeValue(findTestObject(‘Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’),
‘class’, ‘btn btn-primary’, 5)

WebUI.delay(2)

WebUI.uploadFile(findTestObject(‘Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’),
‘\Users\swapnaputta\Downloads\seasonal-wallpaper-1.jpg’)

FilePath = WebUI.getAttribute(findTestObject(‘Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’),
‘\Users\swapnaputta\Downloads\seasonal-wallpaper-1.jpg’)

WebUI.verifyMatch(FilePath, ‘\Users\swapnaputta\Download\seasonal-wallpaper-1.jpg’, false)

WebUI.delay(3)

WebUI.closeBrowser()

you need to set the input not the button type. you have to know how the
uploadFile work. try to ask this with your dev who wrote the page. Or see
if katalon support can help. I spoke my developer and show them the
uploadFile keyword and they suggest to use the data test mark which they
created with type=input.

hope this helps.

Waiki

hi marek can you please tell me how to upload the file in mobile ?
i am really stuck at this point
please help me

my mail id is sujit.g@rubix108.com