buffaloger.blogg.se

Chromedriver download
Chromedriver download










chromedriver download

Profile = Selenium::WebDriver::Chrome::Profile.new We’re registering the driver in features/support/chromedriver.rb so we added the profile there: require "selenium/webdriver"Ĭapybara.register_driver :chrome do |app| We discovered that it’s possible to provide a Chrome profile (just a collection of settings) when registering the :chrome Capybara driver. Capybara had no reference to its content and to make matters worse, Cucumber didn’t wait for the download to finish before moving on. When the scenario ran, Chrome triggered the download as expected but threw the file into my “Downloads” directory. But with such an Ajaxy app, we soon moved to ChromeDriver as our default Capybara driver and our nice green scenario turned an annoying shade of red.

chromedriver download

Page.response_headers.should = "attachment" Then the downloaded file content should be:Įasy enough! Early in the app’s life, we wrote this Cucumber step: Then "the downloaded file content should be:" do |content|

chromedriver download

Our scenario looks like: Scenario: Exporting the fruits list But we recently encountered an issue with a very Ajaxy Rails app where we need to test a file download and assert its content. At Collective Idea, we ♥ Cucumber, Capybara and ChromeDriver… and alliteration.












Chromedriver download