How to upload image on Mac gallery

Hi

I am newbie for using katalon. I have to do step for upload image from my Mac gallery, but it’s doesn’t work. I want click the element then gallery window displayed, but the robot action not working

/**

* User upload image

*/

@Keyword

def uploadImage(TestObject el) {

customClick(el)

Robot robot = new Robot()

robot.keyPress(KeyEvent.VK_PAGE_DOWN);

robot.keyRelease(KeyEvent.VK_PAGE_DOWN);

robot.keyPress(KeyEvent.VK_ENTER);

robot.keyRelease(KeyEvent.VK_ENTER);

}

this is my gallery

Screen Shot 2018-07-11 at 15.20.34.png

1 Like

I’m facing the same issue. It stops after opening the Finder.Any solution to this?Please help

I haven’t checked it but you can read the source code of the File Uploads keyword:

https://docs.katalon.com/katalon-studio/tutorials/handle_file_uploads.html#what-is-file-upload-in-testing

I was facing this issue but then figured out that its because of permission on the Mac. Try this solution as this worked for me.

-Go to System preference on Mac
-Click on “Security and Privacy”
-Select Accessibility and grant “Katalon” the permission that is needed .
-Then try running the script

Attaching the screenshot of the same