Selenium Driver no longer supports access to the response headers.
For alternative methods, see Testing File Downloads with Selenium
These steps are now part of Spreewald.
The step definitions below allow you to test the filename suggested by the server:
When I follow "Export as ZIP"
Then I should get a download with the filename "contacts_20110203.zip"
Capybara
Then /^I should get a download with the filename "([^\"]*)"$/ do |filename|
page.driver.response.headers['Content-Disposition'].should include("filename=\"#{filename}\"")
end
Webrat
Then /^I should get a download with the filename "([^\"]*)"$/ do |filename|
response.headers['Content-Disposition'].should include("filename=\"#{filename}\"")
end
Posted by Henning Koch to makandra dev (2010-12-30 14:00)