Hi I am trying to upload a file using WebUI.uploadFile. Since it was not working I used Robot class. But when I am running this in Jenkins I’m getting error. I believe robot class cannot support this.
How will I upload a file from my T drive without opening file explorer?
I used WebUI.uploadFile as below
WebUI.uploadFile(findTestObject(‘Object Repository/TP/PolicyQuestions/UploadNow’),‘T:\Katalon - Automation\PDFs\Sample.pdf’)
I used robot class as:
** crated a file within the project directory and took from there.
UploadFile(findTestObject(‘Object Repository/TP/PolicyQuestions/UploadNow’), ‘Sample.pdf’)
Hi Chen
I developed the upload funtion using this post itself. as I said using robot file i can upload file but the file explorer will open to select the file.
Also, as the reply says UI has only tag. there is no tag
@smathews Your solution is to use the WebUI.fileUpload API – but you need to use it correctly.
The problem you have is your XPath is locating a button element which does not support uploading a file. You need to target the <input type='file'> element – it’s there somewhere, you just need to find it.