Sunday, October 7, 2012

How delete the cookies,temporary Internet files and browsing history using qtp?

************************************************************
To clear the Cookies
************************************************************
Web applications uses cookies to store user related information. While testing these cookies might interfere with the results of test. It is recommended to delete cookies before starting new test.


  • Using QTP Webutil object  we can delete the cookies
  • Webutil is the undocumented object in the QTP

WebUtil.DeleteCookies()

*******************************************************************
To clear temporary Internet files:
*******************************************************************
Set WshShell = CreateObject(“WScript.Shell“)
WshShell.run “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

*****************************************************************************************
To Clear Browsing History
*****************************************************************************************
Set WshShell = CreateObject(“WScript.Shell“)
WshShell.
run “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1″

1 comment:

  1. if i use the code WshShell.run “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2″ to delete cookies,how to confirm wheather the cookies have been deleted or not?

    ReplyDelete