Quality Testing

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

Views: 4106

Reply to This

Replies to This Discussion

Here you go buddy:

 

WebUtil.ClearCookies

 

--Subbu.

 

Hi subbu,

            Can you provide the script for googlechrome browser...

 

QTP does't support Chrome.

Hi subbu,

              this is the script to delete IE cookies

               SystemUtil.Run "iexplore"
               WebUtil.DeleteCookies          

   correct me if i was wrong,,,

 

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
WebUtil.deletecookies is the direct method available in QTP to delete the cookies

'##################################
'#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

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...

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.

Hi trivedi, thanks for the reply...
Thanks everyone!

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service