Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selenium 2 web driver save as dialog

Tags:

selenium

using selenium 2 with webdriver one of my scripts needs to save a report in pdf or csv both just bring up a save as dialog. I do not know how to interact with it. im trying in firefox for now but would like to get it working in all browsers.

I read a few posts from 2009 that webDriver and selenium could not access save as dialogs but was wondering if there is a workaround floating around now.

I just need to click the save radio button so it does not try to open it then click the save button

like image 653
ducati1212 Avatar asked Jan 18 '11 20:01

ducati1212


2 Answers

Only solution I know of is Firefox only. You can tweak the profile preferences to automatically download some MIME types to a directory of your choice. See my answer here.

like image 199
jarib Avatar answered Sep 23 '22 05:09

jarib


The problem with "SaveAs" and "File Open" dialog boxes is that they depend on the OS on which tests are being run and there is no means for selenium rc to interact with it. The only solution for this is to use some external Desktop Automation script like AutoIt to handle the dialogbox. Here's a good tutorial on how to do this.

Thanks,
Vamyip

like image 37
vamyip Avatar answered Sep 26 '22 05:09

vamyip