SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member
    Join Date
    Oct 2002
    Location
    san franciso, ca, usa
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    deleting cookies via silktest

    hi,
    i was wondering if anyone knew of an easy way to delete a cookie before a testcase is run using silk. the problem is, i have to verify a certain page that is a user agreement. if the user has already clicked the "agree" button before, that information is written to a cookie. thus, if you run the test case again any time after, the user agreement screen will not appear. any help would be greatly appreciated.

    ------------------

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Location
    san franciso, ca, usa
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    nevermind. i think i found a solution. thanks anyway.

    ------------------

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Location
    bangalore
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    Good work

    ------------------

  4. #4
    Junior Member
    Join Date
    Nov 2002
    Location
    Chennai, INDIA
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    Can I have the solution please ?

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    browser.ClearCache ( )

    ------------------

  6. #6
    Member
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    I don't think ClearCache() clears cookies. According to Segue Online support:

    ClearCache is declared for the Browser window. It clears the memory and disk cache of the browser.

    I would record a transaction from IE/Tools/Internet Options/


    ------------------

  7. #7
    Member
    Join Date
    May 2003
    Location
    CA
    Posts
    45
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    Hi,

    I would suggest u to write a function to delete the same (temporary internet files directory (cache))by hardcoding the path or dynamically by taking the attribute and call the function in the TestCaeEnter function, so that the cookies in the browser in deleted before u run.

    Note: If the cookies is not relevant to the AUT,i prefer to disable the cookies option in the browser.

    ------------------

  8. #8
    Member
    Join Date
    Oct 2001
    Posts
    128
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    Try using registry as under (pl give feedback):

    [+] void ClearCookies ()
    [-] // Declare variables.
    [ ] string sBrowserType = [string]GetBrowserType()
    [ ] list of string lsCookieDirs = {}
    [ ] string sCurDir
    [ ] list of FILEINFO lFiles
    [ ] FILEINFO fCurrent
    [ ] integer iKey
    [ ] string sPath
    [ ] string sItem
    [ ]
    [+] // Add main cookie path to list.
    [ ] mswnt ListAppend (lsCookieDirs, "c:\Winnt\Cookies")
    [ ] ! mswnt ListAppend (lsCookieDirs, "c:\Windows\Cookies")
    [ ]
    [+] // Add personal cookie path to list.
    [ ] iKey = HKEY_CURRENT_USER
    [ ] sPath = "Software\Microsoft\Windows\CurrentVersion\Explore r\Shell Folders"
    [ ] sItem = "Cookies"
    [-] do
    [ ] ListAppend (lsCookieDirs, SYS_GetRegistryValue (iKey, sPath, sItem))
    [+] except
    [ ] // do nothing
    [+] // Add personal cache path to list.
    [ ] iKey = HKEY_CURRENT_USER
    [ ] sPath = "Software\Microsoft\Windows\CurrentVersion\Explore r\Shell Folders"
    [ ] sItem = "Cache"
    [+] do
    [ ] ListAppend (lsCookieDirs, SYS_GetRegistryValue (iKey, sPath, sItem))
    [+] except
    [ ] // do nothing
    [ ]
    [ ] // Delete all files in the directories listed. (The file system will prevent some files and folders
    [ ] // from being deleted; this is OK.)
    [-] do
    [ ] ResOpenList ("Clearing cookies from directories.")
    [+] for each sCurDir in lsCookieDirs
    [ ] DeleteFilesRecursive (sCurDir)
    [ ] ResCloseList ()
    [+] except
    [ ] ResCloseList ()
    [ ] reraise

    ------------------
    quality - a way of life!
    quality - a way of life!

  9. #9
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    Silk1,

    You're correct. My bad. Thanks for correcting that.


    ------------------

  10. #10
    Junior Member
    Join Date
    Jan 2002
    Location
    San Francisco CA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: deleting cookies via silktest

    Noobish silktest user here (and first time poster!)Ö

    I tried the suggestion above but I couldnít figure out how to get the DeleteFilesRecursive function to work (I tried some workarounds but they didnít work).

    I hacked a different script out of the above, it seems to work so far with Silk 7.1/W2000/IE6 . The strategy is simple, navigate to the userís cookie folder, select every file, then unselect the first item (which is usually the index.dat file, which canít be deleted), and delete. It only deletes cookies, but I can imagine it being used with Silkís own browser.clearcache function. (By the way, it's odd that Silk hasnít come up with a built-in Delete cookies function yet). Comments, suggestions?

    [-] void ClearCookies ()
    [ ] // NOTE: This was created on Windows 2000!! WinXP tends to default the file view
    [ ] // .. to thumbnails, I haven't figure out a way to work with that yet.
    [ ]
    [ ] // Declare variables.
    [ ] // integer iKey
    [ ] INTEGER iKey
    [ ] STRING sPath
    [ ] STRING sItem
    [ ] STRING sUserPath
    [ ] iKey = HKEY_CURRENT_USER
    [ ] sPath = "Software\Microsoft\Windows\CurrentVersion\Explore r\Shell Folders"
    [ ] sItem = "Cookies"
    [ ] // The following string will locate the current user's cookie directory.
    [ ] sUserPath = SYS_GetRegistryValue (iKey, sPath, sItem)
    [ ]
    [ ]
    [-] do
    [ ] Browser.SetActive ()
    [ ] Browser.Location.TypeKeys ("{sUserPath}")
    [ ] Browser.Location.TypeKeys ("<Enter>")
    [ ] Browser.ListView("#*|$*").TypeKeys ("<Ctrl-a>")
    [ ] Browser.ListView("#*|$*").MultiUnselect ("index.dat*")
    [ ] Browser.ListView("#*|$*").TypeKeys ("<Delete>")
    [-] if BrowserMessage.Exists ()
    [ ] BrowserMessage.Yes.TypeKeys ("<Enter>")
    [ ] sleep (1)
    [-] if BrowserMessage.Exists ()
    [ ] BrowserMessage.SetActive ()
    [-] BrowserMessage.OK.Click ()
    [ ] LogError ("The script tried to delete the index.dat file. Please check.")
    [-] else
    [ ] print ("All cookies were deleted.")
    [-] else
    [ ] print ("There were no cookies found to be deleted.")
    [-] except

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:25 PM.

Copyright BetaSoft Inc.