Quality is delighting customers
Hey Everyone,
Again I am back to Quality Testing, it is Awesome and brillient work. Congratulations to QT Team.
My question is "How to delete browser cookie using QTP?"
Any one having script share me.
Thanks,
Lisa
Permalink Reply by Subbu on September 30, 2011 at 7:54pm Here you go buddy:
WebUtil.ClearCookies
--Subbu.
Permalink Reply by kotla lakshmi kanth reddy on September 30, 2011 at 8:00pm Hi subbu,
Can you provide the script for googlechrome browser...
Permalink Reply by kotla lakshmi kanth reddy on September 30, 2011 at 9:53pm Hi subbu,
this is the script to delete IE cookies
SystemUtil.Run "iexplore"
WebUtil.DeleteCookies
correct me if i was wrong,,,
Permalink Reply by kotla lakshmi kanth reddy on September 30, 2011 at 11:17pm Hi ,,
Deleting IE Cookies
IE cookies can be deleted using WebUtil object which comes with QTP. We need to use the DeleteCookies method as shown in the code below
WebUtil.DeleteCookies() |
The code above is compatible from QTP 8.2 and higher. For versions lower than QTP 8.2, we need to modify the code a bit
Function DeleteIECookies() Set oWebUtil = CreateObject("Mercury.GUI_WebUtil")
oWebUtil.DeleteCookies() End Function |
Permalink Reply by Paruvu Anil Kumar on October 1, 2011 at 10:47am
Permalink Reply by Parag Trivedi on October 2, 2011 at 12:37pm '##################################
'#Function Name: ClearCookies
'#Function Description:The Function clears all cookies that are present on your HardDrive in an Internet Transaction. '#Function Logic: The function opens the Properties Window of Internet Explorer & fires the Click Event for the Delete Cookies ' Button & Delete Temporary Internet Files.
'
' Call ClearCookies()
'
'##################################
Function ClearCookies()
SystemUtil.Run "Control.exe","inetcpl.cpl"
Set objShell = CreateObject("Wscript.Shell")
Do Until Success = True
Success = objShell.AppActivate("Internet Properties")
Wait(1)
Loop
objShell.Sendkeys "%i"
Wait(1)
objShell.Sendkeys "{ENTER}"
Wait(1)
objShell.Sendkeys "%f"
Wait(1)
objShell.Sendkeys "%d"
Wait(1)
objShell.Sendkeys "{ENTER}"
Wait(4)
objShell.Sendkeys "{ENTER}"
End Function
Permalink Reply by kotla lakshmi kanth reddy on October 2, 2011 at 1:07pm Hi Parag Trivedi,
Can you tell does QTP supports one browser for deleting cookies like IE ,and does not support Google chrome,Firefox browsers ,can you share your view...
Permalink Reply by Parag Trivedi on October 2, 2011 at 1:42pm Hi lakshmi,
As of now QTP doesn't support chrome but Support for Google Chrome is planned, but no official release date has been announced.
Permalink Reply by kotla lakshmi kanth reddy on October 2, 2011 at 3:14pm © 2012 Created by Quality Testing.