Hi,
Is there any function or vbscript in QTP to clear the
cookies,sessions. Please help me in this.

Answer Posted / jay prakash

You can write your own function also:

Public Sub MyDelCookies()
'Option Explicit

Dim strPath, WshNetwork, fso, objFol, objFile, var

strPath="c:\Documents and Settings\"
Set WshNetwork = CreateObject("WScript.network")

strPath=strPath + WshNetwork.UserName +"\Cookies"

Set fso = CreateObject("Scripting.FileSystemObject")
Set objFol = fso.GetFolder(strPath)
Set objFile = objFol.files
For Each var in objFile
If var.name<>"index.dat" Then
var.delete
End If
Next
Set WshNetwork=Nothing
Set fso=Nothing

End Sub

Please let me know if it helps.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between quicktest professional (qtp) and winrunner?

577


Explain the terms test and business component?

550


How to data driven test for Win objects in QTP ?

1477


Can we use index on view?

1605


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

1535






In Test Directory, What are the contents in test case designing? if you prepare in excel sheet how u use thrw Test Directory?

1510


Explain step generator in qtp?

651


What is business process testing(bpt) in qtp?

697


While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?

1425


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1473


To which environments does quicktest professional supports?

543


Output values? i want a practical example

1315


What is difference in global and action sheet in qtp?

616


What are the types of object repositories? Which one is you using?

623


In QTP TEST DIRECTOR COMBINATION WHAT IS THE PURPOSE OF TEST DIRECTOR? In Somebody says to store test cases and design test cases.?ok fine , but In test director 5.0 , QTp not launching. what u do?

1496