WebUtil.DeleteCookies()
Function DeleteIECookies()
Set oWebUtil = CreateObject("Mercury.GUI_
oWebUtil.DeleteCookies()
End Function
Function DeleteFFCookies()
Dim FSO, cookiePath
Set FSO = CreateObject("Scripting.
cookiePath = GetFFCookiesPath()
If FSO.FileExists(cookiePath) Then FSO.DeleteFile cookiePath
End Function
Function GetFFCookiesPath()
Dim FSO, oShell
Set FSO = CreateObject("Scripting.
Set oShell = CreateObject("WScript.Shell")
If InStr(Environment("OS"),"
Dim sUserProf
sUserProf = oShell.ExpandEnvironmentString
GetFFCookiesPath = ""
If FSO.FolderExists(sUserProf) Then
Set oFolder = FSO.GetFolder(sUserProf)
If oFolder.SubFolders.Count> 0 Then
'oFolder.
For each oFolder in oFolder.SubFolders
Exit For
Next
'Set oFolder = oFolder.item(0)
Dim sPath
sPath = oFolder.Path
If FSO.FileExists(sPath & "\Cookies.txt") Then
GetFFCookiesPath = sPath & "\Cookies.txt"
End If
End If
End If
Else
Err.raise vbObjectError + 1, "GetFFCookiesPath", "This function has not yet been implemented for your OS - " & Environment("OS")
End if
End Function
Home »
automation testing
,
descriptive programming
,
QTP
,
testing
,
Vbscript
,
Vbscript Function in QTP
,
VBScript in Qtp
» QTP codes & cookies
QTP codes & cookies
3:45 PM
automation testing, descriptive programming, QTP, testing, Vbscript, Vbscript Function in QTP, VBScript in Qtp
No comments
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.