Delete Cookies Using Ruby/Watir

October 1, 2008

1. In your Ruby script, require:

require ‘fileutils’

2. Set the path to your cookies, you can leave the ENV['USERNAME']

$cookieDir = “C:\\Documents and Settings\\#{ENV['USERNAME']}\\Cookies”
3. Call the file utility function to remove the cookies:

FileUtils.rm_rf $cookieDir

Previous post: Delete Cache and Cookies in Ruby

Next post: How to detect bugs caused by network failure? – Software Testing …