Uploading file using Katalon


#1

Hi All,
We can upload the file while automating the UI using the robot with the given code lines.
impot java.awt.Robot

WebUI.click(findTestObject(‘object name’))
StringSelection s = new StringSelection(‘file path along with the extenion’)

Toolkit.getDefaultToolkit().getSystemClipboard().setContents(s, null)

Robot robot = new Robot()

robot.keyPress(java.awt.event.KeyEvent.VK_CONTROL)

robot.keyPress(java.awt.event.KeyEvent.VK_V)

Thread.sleep(1000)

robot.keyPress(java.awt.event.KeyEvent.VK_ENTER)


#2

Hello Karam,

I am moving this to correct category “Tips and Tricks”


#3

sure no problem.
Thankd