automated file upload selenium ide 2.8 on mac

1.1k Views Asked by At

I am experiencing a problem executing automated uploading of a file onto a website.

I'm using selenium IDE version 2.8 via firefox 31 on a Mac to test the process of the web system through a browser in my work. At one point of the process it requires me to upload an excel file.

I have searched many forums and blogs for solution specifically to work on MacOS X with Firefox with Selenium IDE but none helped.

In my script, I have:

command : click

Target : name=...

value :

this line will click on the button which have a text word 'select file' and the 'File Upload' dialog window will pop out for me to select the file i want to download

command : Type Target : driver.FindElement(By.Id("File Upload")) Value : /Users/...../excel.xlsx

this line supposed to find the element by id path in 'file upload' and select the path of the file which is stated by me in the value column.

problem occured: [error] Element driver.FindElement(By.Id("File Upload")) not found

As far as I understand, im not sure if it is correct but from what i read and understand, somewhat works for others but wont work for me. Am I missing something?

2

There are 2 best solutions below

2
On

For this part:

command : Type Target : driver.FindElement(By.Id("File Upload")) Value : /Users/...../excel.xlsx

Can you change the target to id=File Upload ?

3
On

the popup you are talking about is a OS popup you can't simply use it with selenium send the key to the tag with xpath something like " //input[@type='file'] " and then submit the form