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

Answers were Sorted based on User's Feedback



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

Answer / rayudu

webutil.DeleteCookies

Is This Answer Correct ?    9 Yes 1 No

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

Answer / 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

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

Answer / vikrant

Hi
Just write a user defined function and copy paste the
code and associate it with your script. You can call the
function where ever u want in script

Thanks
Vikrant

Is This Answer Correct ?    1 Yes 0 No

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

Answer / babu

Hi rayudu,

I executed the script provided by you . it is working fine.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / latha

where can i inculde the above script?Do i need to call this
for each and every time when the QTP opens new window?

Is This Answer Correct ?    0 Yes 0 No

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

Answer / babu

Hi Latha,
I tried with the script by included in particular actions
where i want.

If i want to use it for each and every execution, i don't
have any idea how to do it. Pls help me out in this.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How may types of defects identify application or your currently working application?pls give me answer..

0 Answers   Cap Gemini,


How to handle Run-time errors?

1 Answers   Crea,


How will u declare a variable to access multiple actions? a)Dim b)Global c)Public d)Private

1 Answers  


Does the Existing reusable action can be modified at the time of calling the action?? Please help me..

2 Answers  


How to check the value for variables during run time. Pls anybody can give the answer.. Thanks in advance...

4 Answers   Navis,






i this is balaji from chennai i have 4 yrs exp in testing and my qualification is bsc computers i completed in correspondace in which companiies accept the correspondace plz let me know

1 Answers   Accenture,


Extract a word from a sentenece?

5 Answers   IBM,


Write a code check the checkbox in the web table which is in the 4th row and fifth column (Use child item concept)

2 Answers   FIS, Wipro,


How to Display last item of a Combobox by using QTP?

10 Answers  


How can we automate Capthca on registration or any contest forms ? Is it possile to Automate Webpages with Falsh using QTP..?

1 Answers  


how to use command prompt using qtp?

8 Answers   HCL,


why use Description programming? what is advantages and disadvantage of this methods?

2 Answers  


Categories