Thread Rating:
  • 2 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
programmatically clear cache
#1
Solved: 11 Years, 3 Months, 3 Weeks ago Question 
Hello,
Is there a way to programmatically clear cache in QTP ?
I'm dealing with a Webapp, and I use webutil.deletecookies to clear cookies. Anything for clearing cache?

Thanks,
Monika
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Is it working fine? we also having so many problems regarding
cookies.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Instead of clearing cache everytime , you can set a one time option of disabling cache from Tools > Internet options > Temporary Internet Files and set the amount of disk space =1 .
Since IE 6 requires the cache space to be greater than 1 MB no pages will be stored from now on.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Code:
Sub DeleteCache()
Dim root
Set root = CreateObject("FPC.Root")
Dim server
Dim cacheDrives
Dim cacheDrive
Dim fso
Set server = root.GetContainingServer()
server.StopFirewallService()
Set cacheDrives = server.CacheDrives
Set fso = CreateObject("Scripting.FileSystemObject")
For Each cacheDrive In cacheDrives
    cacheFilePath = CacheDrive.Name & "\urlcache\Dir1.cdat"
    fso.DeleteFile cacheFilePath
Next
server.StartFirewallService()
End Sub
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  activex automation programmatically nehastar 0 1,642 06-13-2012, 12:00 PM
Last Post: nehastar
  how to clear an entered value in a textbox padmini 2 19,370 09-23-2011, 03:23 PM
Last Post: padmini
  Clear input field before entering text janriis 1 5,890 08-13-2009, 05:53 PM
Last Post: basanth27
  dsn creation manually and programmatically pspsblog 2 2,957 08-09-2009, 06:11 AM
Last Post: pspsblog
Question How to programmatically export/save the result to html ConstantChange 4 6,878 02-25-2009, 01:20 PM
Last Post: Usman Muzaffar

Forum Jump:


Users browsing this thread: 2 Guest(s)