views:

873

answers:

3

Is there any kind of API that can allow me to manipulate a file download dialog in Firefox? (I want to access the one that appears when user does something, not initiate one myself).

What I want to do is to access this dialog from Selenium (and whether Selenium "privileged mode" is enough to access chrome interface is something I am not sure about as well).

+1  A: 

Not that I know of. But you can configure Firefox to automatically start the download and save the file in a specific place. Your test could then check that the file actually arrived.

Aaron Digulla
Ok, I think I'll go with this solution.
Andrey Shchekin
+1  A: 

Dont know, but you could perhaps check the source of one of the Firefox download addons.

Here is the source for one that I use Download Satusbar.

Nifle
Thanks, that very interesting (but proves that is either impossible or insanely hard unless I am writing an extension with xul parts).
Andrey Shchekin
+1  A: 

Hi Andrey, I didnt unserstood your objective, Do you wanted your test to automatically download file when test is getting executed, if yes, then You need to use custom Firefox profile in your test execution.

In the custom profile, for first time execute test manually and if download dialog comes, the set it Save it to Disk, also check Always perform this action checkbox which will ensure that file automatically get downloaded next time you run your test.