From: Arihan Sinha Date: 2010-10-20T04:33:08+09:00 Subject: Re: How to delete the browser cache through ruby Charles Calvert wrote in post #955502: > On Fri, 24 Sep 2010 05:05:24 -0500, Arihan Sinha > wrote in > <4dea75d148cec56675b28729009288b8@ruby-forum.com>: > >>I am using the below code but it seems not working for IE. ( not sure). >>Could anyone please help me how to delete the cache . > > [snip] > >> if @browser_name.to_s =~ /IE/ >> puts "Test is running in window platform with browser IE" >> puts >>Dir.glob('/Users/'+ENV['USERNAME']+'/AppData/Local/Microsoft/Windows/Temporary >>Internet Files/*') >> FileUtils.rm_r >>Dir.glob('/Users/'+ENV['USERNAME']+'/AppData/Local/Microsoft/Windows/Temporary >>Internet Files/*'),:force => true > > It's a bad idea to delete the temporary files at the filesytem level > like that. You could cause errors in the IE instance. Instead, Take > a look at the Win32API functions that you can use for this: > . > > You can access these functions in Ruby using the Win32API library or > the dl/win32 library, both of which are part of the Ruby stdlib. Hi Charles, it seeems the whole delete_cache.rb is mentioned in this thread ( the details code in the previous post) but its very confusing which method need to call. So if you can highlight anything w.r.t that then it would be great. Regards Arihan -- Posted via http://www.ruby-forum.com/.