Forum Discussion
best thread for this would be https://community.smartbear.com/t5/TestComplete-Functional-Web/How-to-ClearCache-and-Cookies-from-Internet-Explorer-9/td-p/89841
Thanks a lot shankar_r. However this seems to be in a language I do not understand. Could you pls. convert it into python or give me some pointers. I tried googling it, but looks like I am making mistakes here and there.
Thanks,
- nwalimbe7 years agoOccasional Contributor
This is the code, I am trying to use:
def ClearAllChromeStoredInfo():
objFSO = CreateObject("Scripting.FileSystemObject")
strAppDataFolder = aqEnvironment.GetEnvironmentVariable(("LocalAppData") & "\Google\Chrome\User Data\Default")
FilesInFolder = objFSO.GetFolder(strAppDataFolder).Files
Log.Message(FilesInFolder)
FoldersInFolder = objFSO.GetFolder(strAppDataFolder).SubFolders
for Folder in FoldersInFolder:
if UCase(Folder.Name) = "EXTENSIONS" and LCase(Folder.Name) = "EXTENSION STATE"
Folder.Delete True
break
For File In range (FilesInFolder)
If Not UCase(File.Name) = "PREFERENCES"
File.Delete
breakThe error I am getting is attached.
- AlexKaras7 years agoChampion Level 3
Hi,
I am not a Python expert. And not sure what line has #4, but maybe the slashes must be doubled? I.e.: "\\Google\\Chrome\\User Data\\Default" ?
Related Content
- 2 years ago
Recent Discussions
- 23 hours ago
- 24 hours ago
- 5 days ago