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 is a data driven test in qtp?

577


How to add verification steps to tests?

9122


What the differences are and best practical application of Object Repository?

583


How can i check items sorted or not in a weblist ? Give me the script for this...

1571


Explain the concept of object repository?

524






what is keyword driven testing in qtp?n how is it useful?

1490


what is object and child object.. explain ..if possible give some example for better understanding ..

1529


What are the ways you can synchronize?

581


Explain the Different types of QTP test assets and their extensions?

603


What are the types of data tables in qtp?

581


in qtp if we record a object and we record the object using virtual wizard then by which way the object is recognized that means recorded

1519


Explain the qtp test phases.

614


i have a doubt can anyone tell me where are scripts stored while using QTP.Tell me the exact procedure takes place in real time?like how we call scripts how to proceed after writing scripts?how scripts are executed etc?i heard some use Qc whether others dont use.so tell me whole procedure for both the things it will be a very big help.as i have interview i want to have whole idea on this.its very urgent.

1380


Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?

2968


Write a script to customize the test results in PDF and HTML format.

2082