How to automate file upload scenario for mac OS using selenium with Java 17

169 views
Skip to first unread message

vinit ratan

unread,
Dec 25, 2023, 8:59:27 AM12/25/23
to Selenium Users
Hi All,

I am trying to automate, file upload scenario on mac OS for one of my test case. I tried below approach but they are not working:

1. Trying to input file path using send keys after clicking on the upload button.
2. Using Java Script executor code, which again uses the approach of sending file path.
3. Using the robot approach where we use robot keyboard commands of pressing enter, left, right, up and down to navigate to the particular file and select it.


I am also trying to use Robot framework code along with, code for Copying file path to Clipboard. For this approach we need to use java.awt.Robot (which is present in Java.Desktop) and java.awt.datatransfer (which is present in java.datatransfer). However, on trying to run this code I am getting error, java.awt is present in both java.desktop and java.datatransfer module.

Can anyone please suggest solution for this problem. or any other solution/approach that I can use to automate file upload scenario on mac.

Thanks in advance
Regards
Vinit ratan

Suriya Elamparithy

unread,
Jan 9, 2024, 8:21:46 AM1/9/24
to Selenium Users
Reply all
Reply to author
Forward
0 new messages