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 does QTP identifies the object in the application?

1 Answers   Crea,


Why we are selecting QTP for testing ?

20 Answers   HP,


write a script to verify links on any web page by using descriptive method by creating a description object (give a filter condition only link) ... need to verify expected like name by reading

0 Answers  


What is method name to compare two XML files.

0 Answers  


In my script there is a link(e.g. 'My Page') when I execute the script sometimes(not every time) QTP throws an error that "My Page(as link)" not found. Pleaase tell me where I need to update

3 Answers  






How can I pass values from one action to another in QTP ?

8 Answers   Ordain Solutions,


How do you check ticket cost and ticket number in flight application?

0 Answers  


hi everyone today is the first time i saw this website,and hi iam siraj,iam very impressed by seeing evryones response towards questions,iam a newcomer and i have got tryining in testing can anyone please send me some projects relaited to testing.i know it is very confidential but still if u send it will a great help. my mail id venku_krs@yahoo.co.in

1 Answers  


I want to assign values in a table in my software, in first column i will give values, table is of 4x4 i.e 4 row and 4 columns, i m using VBScript in my automation work. it is a simple table for giving values.

4 Answers   TCS, Wipro,


When u r running a script , if u get a popup window that describing that u have received a mail to your outlook application. so to avoid the interference of the popup window , which recovery scenario(popup,object state,application hang,system crash) would u use ?

4 Answers   Accenture,


What is AUT in object reposity in QTP? Why we use it in Object repository???What is full form???????

6 Answers  


what is input pramater out output pramater ?i want the decrepation..?how to use in QTP?

3 Answers   Infinite Computer Solutions,


Categories