cancel
Showing results for 
Search instead for 
Did you mean: 

How to ClearCache and Cookies from Internet Explorer 9

SOLVED
Highlighted
Occasional Contributor

How to ClearCache and Cookies from Internet Explorer 9

How to ClearCache and Cookies for Internet Explorer 9 in test complete using vb script as the language .



Please help .
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Regular Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

You can use the following call to clear cache, cookies, passwords, and anything else. If you want to be more selective you will have to change the 255 value to something else. You should be able to find the proper values through Google...



    Set objShell = CreateObject("WScript.Shell")

    objShell.Run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"






View solution in original post

5 REPLIES 5
Highlighted
Regular Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

You can use the following call to clear cache, cookies, passwords, and anything else. If you want to be more selective you will have to change the 255 value to something else. You should be able to find the proper values through Google...



    Set objShell = CreateObject("WScript.Shell")

    objShell.Run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"






View solution in original post

Highlighted
Regular Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

Also here are the equivalents for Chrome and Firefox:



' Clears the Chrome cache, passwords, cookies, etc...

Sub ClearAllChromeStoredInfo

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    

    strAppDataFolder = AQEnvironment.GetEnvironmentVariable("LocalAppData") & "\Google\Chrome\User Data\Default"

    

    Set FilesInFolder = objFSO.GetFolder(strAppDataFolder).Files

    Set FoldersInFolder = objFSO.GetFolder(strAppDataFolder).SubFolders

    

    For Each Folder In FoldersInFolder

        If Not UCase(Folder.Name) = "EXTENSIONS" _

        And Not UCase(Folder.Name) = "EXTENSION STATE" Then

            Folder.Delete True

        End If

    Next

    

    For Each File In FilesInFolder

        If Not UCase(File.Name) = "PREFERENCES" Then File.Delete

    Next

    

End Sub



' Clears the Firefox cache, passwords, cookies, etc...

Sub ClearAllFirefoxStoredInfo

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    

    strLocalAppData = AQEnvironment.GetEnvironmentVariable("LocalAppData") & "\Mozilla\Firefox\Profiles"

    strRoamingAppData = AQEnvironment.GetEnvironmentVariable("AppData") & "\Mozilla\Firefox\Profiles"



    Set FoldersInFolder = objFSO.GetFolder(strLocalAppData).SubFolders

    For Each Folder In FoldersInFolder

        Folder.Delete True

    Next

    

    Set FoldersInFolder = objFSO.GetFolder(strRoamingAppData).SubFolders

    For Each Folder In FoldersInFolder

        Set FilesInFolder = Folder.Files

        For Each File in FilesInFolder

            If Instr(1, File.Name, "sqlite") > 0 Then File.Delete

        Next

    Next

    

End Sub
Highlighted
Occasional Contributor

RE: How to ClearCache and Cookies from Internet Explorer 9

Thanks a lot Hugo  🙂
Highlighted
Community Hero

RE: How to ClearCache and Cookies from Internet Explorer 9

Command-line versions of Hugo's code:

http://www.catonmat.net/blog/clear-privacy-ie-firefox-opera-chrome-safari/
Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Super Contributor

Re: RE: How to ClearCache and Cookies from Internet Explorer 9

Can Some one provide me how to clear cache and cookies from the browsers using JavaScript ?

 

Please advise

 

Thanks

NG

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors