I am using selenium to record some tests. We have a save to pdf button on our application that gen开发者_开发百科erates the windows open/ save or in firefox the ok/cancel windows pop up, The issue is that i can;t get selenium to record my ok or cancel action since i think it is not a javascript window?
Does anyone know the command to do that? thanks
Sadly, it's not possible to interact with such windows at the moment.
A good workaround for saving files dialog is to save the various parameters (local directory, etc) and tell your browser to not prompt for them, so the window won't pop at all.
See http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-Whatyoucan%27tdowithSelenium
Create a separate firefox profile(command to open profile manager:-firefox -P) with the settings you want(you can give settings like where to download and save a file of a particular type automatically without prompting) and instruct your server to use that profile using the command : java -jar 'your server ' -firefoxProfileTemplate 'path_for_firefox_profile'
精彩评论