Selenium IDE - Upload file into field

FlameDra picture FlameDra · May 14, 2018 · Viewed 10.5k times · Source

I'm creating a testing suite to automate some parts of data input on my web application. I have a page where I can click on a button to upload a document to the application. It looks something like this:

screenshot 1

Once the Add New Attachment button is clicked, it opens the browser's file explorer to select a document to upload. I'm trying to replicate this within Selenium IDE.

Here is what it looks like as of now:

screenshot 2

However, this part seems to fail. Does anyone know how to achieve a similar process using Selenium IDE? I'm on Chrome and Firefox.

Answer

AndreVitorio picture AndreVitorio · Sep 3, 2019

If you get the

{"code":-32000,"message":"Not allowed"}

on Chrome, follow the steps below:

Window > More Tools > Extensions > Selenium IDE > Details

Then turn on the 'Allow access to file URLs' option.

I was having the same problem and this worked for me.