disable the cache

This commit is contained in:
John Bintz 2013-01-27 14:42:11 -05:00
parent 118472bb7d
commit fbcdeacddd

View File

@ -9,7 +9,20 @@ module PersistentSelenium
end
def browser
@browser ||= Selenium::WebDriver.for(@browser_type)
case @browser_type
when :firefox
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.cache.disk.enable'] = false
profile['browser.cache.memory.enable'] = false
profile['browser.cache.offline.enable'] = false
profile['network.http.use-cache'] = false
options = { :profile => profile }
when :chrome
options = { :switches => %w{--disk-cache-size=1 --media-cache-size=1} }
end
@browser ||= Selenium::WebDriver.for(@browser_type, options)
end
def options