What is Cookies, What would you test in cookies, Cookies in QTP



What is Cookies, What would you test in cookies, Cookies in QTP

What is cookies ?
What would you test in cookies ?

Cookies are just like a small files which saved or stored on the sessions or the between two login attempts. These small files are available on our computer. Therefore we have some legal reasons where we required to delete these cookies. We also can delete these cookies through scripting.

So now how you can delete these cookies with the help of VB script in the QTP? Let use explain it. Such repeated questions you offently found multiple places so first I will provide some hint here.

  1. First we require to create a custom function of this. Because IMHO, No direct way is available here.
  2. So Now write a shell script to reach the cookies residing file in our corresponding location folder.
  3. Now when the function will executed then all files inside this will be deleted from that folder.

So we can use the WebItil.DeleteCookies when and if we want to delete cookies from I.E.

One Simple example is provided below:

Example1:
Browser("Browser").WinToolbar( "ToolbarWindow32").Press "&Tools"
Browser("Browser").WinToolbar ("ToolbarWindow32").Press "&Tools"
Browser("Browser").WinMenu ("ContextMenu").Select "Delete Browsing History…"
Browser("Browser").Dialog( "Delete Browsing History").WinButton("Delete cookies").Click
Browser("Browser").Dialog ("Delete Browsing History").Dialog("Delete Cookies").WinButton ("Yes").Click
Browser("Browser").Dialog ("Delete Browsing History").WinButton("Close").Click

Example2:

How we will developer the code for delete the cookies →

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 






Advantages and Disadvantages of Automation Testing













Use of add-ins
Cookies in QTP


What is Object Spy in QTP Ordinal Identifiers Alone can Make an Object Unique



Test Automation Frameworks Types



No comments:

Post a Comment

Popular Posts