Need help for Upload a file in Headless mode(Chrome)

Hello All,

Can anyone help me on ‘How to Upload a File in Headless mode(Chrome)’.
I have tried below step for the same :
1. I have used the upload file keyword which is working fine in ‘Normal’ mode but not in Headless mode.
Keyword :


2. The different way than Custom keyword i have tried is by using a ‘Upload File’ WebUI keyword in script, But it is not working neither in Normal nor in Headless.
3. The third way I have tried by using ‘Send keys’, But same, not working in Normal and Headless.

  • Using second point which is ‘Upload Keyword’, My script is failing and giving error message as below :

  • Using first point which is ‘Upload File’ keyword, script is getting failed and giving error message as ‘Element is not visible’ for the browser popup which will display on the screen to select/browse a file.

Please suggest a resolution for this issue.

Thanks in advance!

Note : ‘Upload File’ custom keyword is getting successfully executed in Normal browser execution

@upyati, Try this for non headless (it might work for headless too): How-to use ‘sendKeys’ or 'File Upload' to upload files

1 Like

Hi @Dave_Evers ,

Thanks for the reply. I have tried, but this is not working in my Case as there is no any hidden object for Upload document button/field in page source. Also, Custom Keyword for Document Upload in Normal execution is working fine. I am facing issue only for Document upload functionality in ‘Headless Execution’.

Please suggest!

Hi @upyati, Try reviewing this post: How to upload a file without opening file explorer (headless)

If it doesn’t work try searching the forum for more possible solutions.

Good luck,
Dave