java.awt.Robot does not work for handling “File Upload” dialog window when executed via Jenkins as a Service job

Hi Team,

I have a test script which uses the Robot framework for uploading an HTML file. The test script suite works fine in my local system, however, when I am running it in the Docker Container (Jenkins as a Service), I am getting the following error (screenshot below):

This is how I am handling it in the script:


Since the Jenkins job is executing it from Git, the path I am using for file upload is:

StringSelection ss = new StringSelection("./Data Files/S_4_HANA_Contact_Us_EN.HTML")

Where ‘Data Files’ is the folder in my Git repository where the file to upload is stored.