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

What is the recovery scenario in qtp?

0 Answers  


How to use parameterization in qtp?

0 Answers  


Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5

9 Answers  


what is the command (keyboard command) to swith from expert view to key word view

3 Answers  


1. In build1 there is a page with two check boxes and a submit button. You have prepared a script for that page and its working fine. In Build 2 the developers have added two checkboxes in the page. Will the script prepared for Build 1 work for Build 2 or not. If yes, why and if No, why. Remember the developers have not touched the object properties of the textboxes in the page.

3 Answers   ADP,


what r the executing modes in QTP

2 Answers  


What is test object model in QTP ?

8 Answers  


When i used this below script to insert value in the Datatable... At run time it was inserting the given value in the specified column, But after execution all those inserted values were cleared automatically... datatable("column name",sheetid)=value

1 Answers  


I want to scroll down in MSPAINT (captured a screen already). So that I can read the data in it through the step Window(paint).GetVisibleText for my validation. Anyone know the scripting for this?

1 Answers   TCS,


A web page has two butons with same properties and rotating in clockwise direction. how to click on any of the button?

2 Answers   Virtusa,


What r types of parametarizations?

6 Answers  


when we apply the daily build each and every day,the property may change in the application.so that the created script is not reusable in winrunner and qtp.for ex for date field it is taken dtpicker.at another time it is taken some other name.how can i solve it.

0 Answers  


Categories