Friday, 13 January 2017

Test Case Eligibility Criteria - Feasibility Analysis for Automation Testing

Following are few key points to check test case eligibility criteria/feasibility analysis for automation.

Test Case Eligibility Criteria For Automation
Category Parameters
Test Case/Scenario Structure Test Case should be well documented with
-          Defined test data
-          Prerequisites Documented
-          Clear pre and post conditions should be clearly defined or highlighted for individual steps
Test Tool Feasibility Application objects ranging all the navigational pages across the test flow should be identified by the underline automation tool
System/Test flow Test case should not contain steps that execute that involve partial execution of few steps and then wait for the system refresh for undefined hrs and continue once the system is refreshed with the required data.
These type of test cases fall under partial automation criteria and once automated these test cannot be executed in an unattended way, as the refresh time is not defined
3rd party application integration In case the test case integrates with any 3rd party application, then it would be recommended to  check the data flow between these system to ensure seamless execution of the automated tests.
Test Case Complexity Test case tending to be too complex with respect to automation and having limited execution cycles are not recommended for automation.
Hardware Interaction In case the test case interacts with an external interface, feasibility of the interface is considered while prioritizing the test case for automation, depending on the availability
Cross Browser Testing UFT supports IE, Chrome, Mozilla with limited versions. If there are any test cases for automation to execute on multiple browsers then we have to evalute those browsers with versions
Non Functional Testing - Verifying web page content with alignment, format, auto numbering, paragraphs..etc Not good candiate for Automation
Automation Testing in a Multi-Country / Multi-Lingual Deployment(localization testing) More effort required to create scripts to adopt locatization(multi-lingual) testing. PoC is required to evalute this

Monday, 9 January 2017

Effective way of automating SAP applications for various releases/changes

Choosing the right automation approach, strategy and following industry best practices, guidelines will help us to faster time to market in SAP
project deliveries

Many organizations use SAP software in their various departments to take care of everyday business processes. The variety of configurations and
extensions possible increases the need for testing such business processes and mission-critical applications before releasing new SAP functionality
to potentially thousands of users.

As Fred Brooks, the infamous author of The Mythical Man-Month was once quoted,
“Nine women can’t make a baby in one month.” Beyond a certain point, you cannot practically shorten cycle time simply by adding more testers.
Communications overhead, training, license management and data management all come into play.

Why we have to carry out Automation Testing on SAP applications?
In this dynamic and competitive industry, immediate implementation of crucial business can help us to reduce cost and increase market share.
It’s true that test automation tools are designed to dramatically cut costs, manual labor, and shorten testing duration.
• Limited time and budget for development and QA cycle
• Huge number of test cases for execution to ensure robust testing for critical business processes
• Large number of changes in system with each release of an application
• Distributed and diverse legacy applications
• Risk associated with interfaces involved
• Manual testing requires large number of testing team, results in higher number of errors, provides less test coverage, offers inconsistent
results and is time-consuming

How Automation can address these Challenges
• Reduced cost of failure by early detection of bugs and issues during testing
• Reduced cost, by completing the QA cycle quicker
• Automated testing is consistent and repeatable
• Automation routines can be executed for data setups like creation of master data & variants
• Reporting and critical defect detection inputs for impact analysis
• Automated tests can extract variable data from one application and pass it to a test to run in another module, ensuring different
application modules and interfaces work well together
• Once created and benchmarked, the automation suite needs minimum manpower to execute tests during each cycle, eliminating the
need for experts in all SAP modules
• Automation is the way to cost-effectively and consistently achieve adequate test coverage. It provides proof of compliance to law with
strict quality regulations and audit trail standards
• Automation ensures reliability of mission-critical business processes like financial month-end closings, bank reconciliation, production
planning, sales order entry, etc
• As new versions of R/3 are implemented and “hot-packs” applied, automated tests can be re-executed for regression testing for critical
business processes to be performed without error
• Test suite can be used for regression testing while legacy system software, networks, server hardware, and communication components
are upgraded to prevent a negative impact
• Automation ensures uniformity in the testing process each time a test is executed
• Scripts can be executed at night or on weekend’s unattended – huge value in time crunch
• Test scripts can run independently with minimal human intervention in multiple sessions
• Given the challenges, it is clear that automated regression testing is not a luxury but a necessity. Having identified these challenges and
decided that automation is the way to go, it becomes imperative to develop the correct roadmap. The first step in this path is choosing
the right test tool and automation framework.

Know how to automate SAP tests
Testing SAP releases and upgrades is a challenging, time consuming and complex activity. Many organizations would like to automate their SAP
testing but often don’t know the best way to approach this.
Usually this results in the effort required to maintain automated Test Scripts being as high as that required to maintain SAP itself which is why over
70% of test automation initiatives fail to meet their anticipated Return on Investment. There are a number of reasons for this: Lack of experienced
automation testers, custom automation frameworks that do not create the necessary efficiencies, incorrect choice of test tool, and management
overhead are a few but there are many more. Our solution overcomes these challenges in an innovative and unique way.
Approach:
• Is proven to be a faster and more efficient method to automate tests
• is based on a world leading platform
• increases the coverage and speed of regression testing your existing functionality
• reduces the likelihood of mistakes being released into your production system
• eliminates the need to waste time and money creating a custom automation framework
• provides consistent, low level tests step documentation for the automated tests

• Integrates with ALM or Test Management tools

Providing accurate effort estimation:
Well defined SAP Automation/manual estimation templates, up on entering just few key values, estimates are automatically generated as they are formula driven.

Choosing the right framework:
Key success of automation is choosing the right framework for the tool to get maximum benefits with less time.
Component/Function/Method Driven: built up with various reusable functions and called in test scripts on need basis
Pros: Quick & easy to implement, popular, supported by HP UFT, SAP TAO, SAP CBTA, Worksoft Certify, and other tools.
Cons: Not as robust as Keyword Driven framework and coding expert is required
Keyword Driven: requires pre development of keywords and selecting keywords to make test script ready
Pros: Robust framework, can be deployed independent of test tool and application under test
Cons: Detailed steps for each test condition need to be documented, more initial time required
Hybrid Driven: most frameworks evolve into the hybrid framework – a combination of the above two frameworks which brings together their
strengths and mitigates their weaknesses
Component/Function/Method driven framework is best for SAP applications and it is quick and easy to implement with maximum ROI with short
span of time

Identifying the best Test management tool:
Test management tool should be open to integrate with internal and external automation tools to execute entire project management, it may be
adding Cycles, releases, requirements, manual and automation test scripts, results and reports, defects and dashboards..etc.
Ideally HP ALM (formally known as HP Quality Center) best for test management tool
Identifying right business scenarios for regression automation testing
Analyzing the system along with SMEs and stack holders and finding out key business scenarios where it is required to execute such scenarios
repetitively on each release is an important activity before kicking off automation testing.
• Is automation feasible for the selected scenarios/ test cases?
• Test cases are required to execute repetitively on each release/cycle multiple times
• No manual intervention during script execution
• Able to run script independently or in batch
• Always ROI focused
• Identify areas of ERP that have been customized as customizations can have an adverse effect on functionality and performance that
must be tested with every build
• Concentrate testing on interfaces with communication between SAP & legacy system
• Scenarios/transactions which need to be tested with different data sets/values
• High path frequency: Scenarios/process paths used with high degree of frequency when the software is running in full production.
Examples include creating customer records, invoicing and other high volume activities where software failures can occur frequently.

Performing Feasibility analysis (FA) and Proof of Concept (PoC):
Carrying out FA and PoC is really required for any automation testing project. It will definitely provide immediate feedback on our automation
testing capabilities and success ratio of our automation regression pack which we supposed to automate
E2E Test Management with Solution Manager:
With SAP Solution manager we can successfully carry out End to End test management as show in below picture. This includes various automation
tools called CBTA, HP UFT/QTP, Worksoft Certify, SAP TAO..etc

Easy to identify changes in SAP system for automation:
Transporting mechanism happens in SAP system in vary controlled way, each and every change is linked to executable object and added to
transport, so that at the end of transport, we come to know changes/additions happens in new SAP application
To control the transport and objects we have SAP BPCA (Business Process Change Analyzer) in it. So it is recommended to perform transports with
BPCA to track the changes in system. BPCA has an option to find out which test scripts got impacted because of certain transport, and this will give
us direct solution where to fix the script

Benefits with automation approach:
• Good amount of returns on our investments
• Saving substantial amounts of staff time previously spent on running regression tests
• Improving the quality of services by catching data-related defects before production
• Speeding up testing and application deployment cycles to create greater business agility
• Fostering collaboration between IT and business experts to streamline technology projects
• Double/Tripling the percentage of business processes automated
• Operational efficiency
• Reduced risk of application failure
• Improved customer experience
• Foster time to market

Key Considerations for Developing Automation Scripts Architecture for SAP
• To automate all critical business end-to-end scenarios, each scenario is split into test conditions, and each test condition broken down
into unique SAP T-Codes that must be executed
• Each unique SAP transaction is scripted as a reusable action under the Common Reusable library.
• Each reusable function/action is called in different scenarios. All the required parameters to execute the reusable function/action are
passed through the driver script
• Error handling, common functions also built into reusable common library; included in each script
• Using test management tool, test sets are created for each business scenario; test conditions are added to test set to complete testing &
validation of one end-to-end business process
• All scenarios required to be tested in each regression cycle are set for execution using individual test sets driven by test management tool
• The structure of having of one test script per test condition provides great modularity and ease of maintenance and debugging. If a test
condition fails, it is easy to detect which test condition and corresponding test script in the complete business scenario caused the issue
and broke the execution
• Separate the test data from the scripts. Maintain all the required Master & Transactional data in separate files. These files input the
required data to the scripts during execution
• Estimation & planning of effort required to completely build the regression test suite becomes easy. Calculate the effort required to build
script for each unique T-Code, common reusable library functions, error handling functions, developing of calling scripts and integration
of individual test conditions into scenarios
• Proper coding & commenting guidelines should be documented; all team members must follow the same
• Peer review process to ensure all scripts are well reviewed
• Ensure all the required test data (Master and Transactional data) are current and valid.
• Perform dry run to integrate and run scripts to test a complete business transaction
• Proper documentation for each test script
Preparing Test Suites with batch of automation test scripts
It is always good practice to create batches of test scripts as below, so that you will quickly get to know the feedback of the system quality
• Sanity pack
• Integration Pack
• Regression Pack
• CR Specific Pack
Generating Test Results:
Generating user friendly test results plays an important role here, as test results files can be used as evidences for future purpose.

Script Health Checkup:
We have to consider Automation testing as typical application development process; otherwise we may end up with failure at the end. As part of
this, making sure scripts are working fine on regular intervals is essential’
• Scripts evaluated and reviewed against checklist of following parameters periodically to ensure regression suite is up to date and ready
during regression testing of the SAP release:
• Apart from maintenance, scripts are executed periodically in batches overnight and test results analyzed. In case of failures, scripts are
updated to correct errors.
• Test data for each test script valid and current
• Test environments (SAP, other systems, databases & interfaces) up and running
• All required changes suggested incorporated and script up to date
• Test environment. setup, connectivity, tool license, configuration and tools available
• Test set and test scripts pulled in Test Director before execution starts
• Test cases are up to date and scripts reflect current steps as per test case
• Required results & defects reporting templates in place
• Access to SAP system & transactions and other systems/databases available
• ‘All clear’ in test results report and no issues identified with scripts during dry run

Friday, 9 December 2016

Measuring time taking to load object with QTP / UFT (Performance Testing with UFT)

Unlike LoadRunner or any performance testing tools, with QTP/UFT we can't reach to hard core features like running script with multiple Virtual Users as thread or a process. But we can get time taking to load for objects we are looking for.

This is pretty simple by implementing a simple loop and verify for the object is loaded. Below is the code snippet for the same.

Browser("BrowserName").Page("PageName").WebEdit("user").Set "XXXX"
Browser("BrowserName").Page("PageName").WebEdit("password").SetSecure "XXXX"
Browser("BrowserName").Page("PageName").Image("Login").Click
dblStartTime =  timer

set  objLink = Browser("BrowserName2").Page("PageName2").Link("Link1")

blnStatus = WaitForObject(obj)

dblEndTime = timer
'Print blnStatus
'Print dblStartTime
'Print dblEndTime
Print (dblEndTime-dblStartTime)

Function WaitForObject(obj)
    WaitForObject = false
    For i = 0 to 10
        If obj.Exist Then
            WaitForObject = true
            Exit For
        End If
    next

End function

Monday, 7 November 2016

SAP CBTA - Posibility of storing output parameter in TDC - Transferring output parameter across CBTA script

There is no option to store CBTA script out put parameter in TDC(Test Data Container) though we can display it in results.

If our requirement is passing one script output parameter as input parameter for other script then make composite script by pulling both 2 CBTA scripts together

 Once we have exported output parameter value from one CBTA script(details highlighted in above screenshot) we can import that parameter in other CBTA script (details highlighted in below screenshot)


If we are expecting to pass parameter across composite script then we only have option to write custom code to export parameter and later create another custom code to import that parameter.

Below are few sample custom component codes to use it.

'====================================================================
''Function to update column value in excel file
'====================================================================
Public Function uf_XLS_UpdateColumnValue(sExcelPath, sSheetName,sSearchCriteria , sField, sValue)

  Dim objExcel
Dim objWorkbook
Dim sColumnName
Dim iKeywordRow
Dim iFeildColumn
Dim arrSearchCriteria

arrSearchCriteria = Split(sSearchCriteria,"=")
sKeywordField = arrSearchCriteria(0)
sKeyword = arrSearchCriteria(1)
     
    Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open(Trim(sExcelPath))
objExcel.Sheets(Trim(sSheetName)).Select

iColumnNumber = objExcel.Cells.Find(Trim(sKeywordField)).Column
sColumnName = uf_XLS_ConvertColNoToColName(iColumnNumber)

iKeywordRow = objExcel.Range(sColumnName & ":" & sColumnName).Find(Trim(sKeyword)).Row
If sField = "" Then
iFieldColumn = objExcel.Cells.Find(Trim(sKeyword)).Column + 1
Else
iFieldColumn = objExcel.Cells.Find(Trim(sField)).Column
End If
objExcel.Cells(iKeywordRow, iFieldColumn) = sValue
objExcel.ActiveWorkbook.Save

If Err.Number <> 0 Then rc = micFail Else rc = micPass
    objWorkbook.close
objExcel.Application.Quit
    Set objWorkbook = Nothing
Set objExcel=Nothing

uf_XLS_UpdateColumnValue = rc
End Function

'====================================================================
''Function to retrieve column value from excel file
'====================================================================
Public Function uf_XLS_GetSpecificColumnValue(sExcelPath, sSheetName,sSearchCriteria , sField)
  Dim objExcel
Dim objWorkbook
Dim sColumnName
Dim iKeywordRow
Dim iFeildColumn
Dim sValue
Dim arrSearchCriteria

arrSearchCriteria = Split(sSearchCriteria,"=")
sKeywordField = arrSearchCriteria(0)
sKeyword = arrSearchCriteria(1)
 
    Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open(Trim(sExcelPath))
objExcel.Sheets(Trim(sSheetName)).Select

iColumnNumber = objExcel.Cells.Find(Trim(sKeywordField)).Column
sColumnName = uf_XLS_ConvertColNoToColName(iColumnNumber)

iKeywordRow = objExcel.Range(sColumnName & ":" & sColumnName).Find(Trim(sKeyword)).Row
If sField = "" Then
iFeildColumn = objExcel.Cells.Find(Trim(sKeyword)).Column + 1
Else
iFeildColumn = objExcel.Cells.Find(Trim(sField)).Column
End If
sValue = Trim(objExcel.Cells(iKeywordRow, iFeildColumn))

objWorkbook.close
objExcel.Quit
Set objWorkbook = Nothing
Set objExcel=Nothing

uf_XLS_GetSpecificColumnValue = sValue
End Function

'====================================================================
''Function to write value in text file
'====================================================================
Public Function uf_FS_WriteTextFile(sFilePath,sData)
   Const ForAppending=8
'Objects for Text File
Dim objTextFile, objSetTextFile
' Create A test file object
Set objTextFile = CreateObject("Scripting.FileSystemObject")
' Open it in Append Mode
Set objSetTextFile = objTextFile.OpenTextFile(sFilePath,ForAppending,True)
'Write the data into the file
objSetTextFile.WriteLine  sData
'Close the file
objSetTextFile.Close

If Err.Number <> 0 Then rc = micFail Else rc = micPass
uf_FS_WriteTextFile = rc
End Function
'===================================================================
''Function to read value from text file
'===================================================================
Public Function uf_FS_ReadTextFile(sPath)
Const ForReading=1
'Objects for Text File
Dim objTextFile, objSetTextFile
' Create A test file object
Set objTextFile = CreateObject("Scripting.FileSystemObject")
' Open it in Read Mode
Set objSetTextFile = objTextFile.OpenTextFile(sPath,ForReading,True)
'Read the data into the file
strFileData= objSetTextFile.ReadAll
'Close the file
objSetTextFile.Close
uf_FS_ReadTextFile = strFileData
End Function
'==================================================================

Monday, 1 August 2016

Reading data from PDF files using QTP/UFT tool

Reading data from PDF files using UFT tool

We might have come across reading the pdf files (probably reports) while automating our test cases. Many of our Automation testers might have faced difficulties to access PDF files, but with below approach we can overcome this issue and play around with PDF files with UFT tools.

Accessibility of PDF
The Adobe Portable Document Format (PDF) is a file format for representing documents in a manner independent of the application software, hardware, and operating system used to create them, as well as of the output device on which they are to be displayed or printed.
PDF files specify the appearance of pages in a document in a reliable, device independent manner Adobe provides methods to make the content of a PDF file available to assistive technology such as screen readers. On The Microsoft Windows operating system, Adobe Acrobat and Adobe Reader export PDF content as COM objects. Applications can interface with Acrobat or Adobe Reader in two Ways:

1. Through Microsoft's Active Accessibility (MSAA) interface, using MSAA objects that Acrobat or Adobe Reader exorts.
2. Directly through exported COM objects that allow access to the PDF document's internal structure, called the Document Object Model (DOM).

The Microsoft Windows version of Acrobat is an OLE Automation server. In order to use the OLE objects made available by Acrobat, we must have the full Acrobat product installed on your system!!

For creating OLE AcroExch.App objects , we requires trail/licensed version of acrobat professional or Licensed version of acrobat standard.
We cannot create above object with without installing acrobrat professional/standard softwares, It gives activeX error. No trail version for acrobat standard available.

How to install acrobat professional software:
With the URL: https://acrobat.adobe.com/us/en/free-trial-download.html?sdid=KQUSA

Click on “Get started” button
This will take few minutes to download.
At the end it downloads software with name: acrobatProDCXXXXXXXXXX.exe
Install it with admin rights.
This whole installation process takes 20-30 minutes time
Once installation is ready, you are good to go to create Acrobat COM and DOM objects (AcroExch.App, AcroExch.AVDoc)

Below is the sample code to read PDF file with AcroExch OLE object
’Below Function reads to PDF file and put the content in txt file.
Call PDF_ReadPDFFileAndSaveinTextFile("C:\Govardhan\Testing\mi-certificate1.pdf","C:\Govardhan\Testing\testt.txt")

Public Function PDF_ReadPDFFileAndSaveinTextFile(strPDFFilePath,strTxtFilePath)
     
    On Error Resume Next
 
    'strFileName = "C:\Govardhan\Testing\mi-certificate1.pdf"
    Set AcroApp = CreateObject("AcroExch.App")
    AcroApp.Show
    Set AcroAVDoc = CreateObject("AcroExch.AVDoc")
    AcroAVDoc.Open strFileName,""
    Set AcroAVDoc = AcroApp.GetActiveDoc
    Set AcroPDDoc = AcroAVDoc.GetPDDoc
 
    For i = 0 To AcroPDDoc.GetNumPages - AcroPDDoc.GetNumPages
 
      ' AcquirePage: Acquires the specified page. The first page in a PDDoc is always 0. returns true if successful and false otherwise.
 
      Set PageNumber = AcroPDDoc.AcquirePage(i)
 
      'the Hilite list object is being created
 
       Set PageContent = CreateObject("AcroExch.HiliteList")
       PageContent.Add 0, 20 ' getting 3 words of first page.
 
     'text selection AcroTextSelect is being created
 
       Set AcroTextSelect = PageNumber.CreateWordHilite(PageContent)
 
       'GetNumText: Gets the number of text elements in a text selection. Use this method to determine how many times to call the PDTextSelect.GetText method to obtain all of a text selection’s text.
 
       For j = 0 To AcroTextSelect.GetNumText -1
            Content = Content & AcroTextSelect.GetText(j)
        Next
    Next
 
    msgbox Content
 
    'strFile = "C:\Govardhan\Testing\test.txt"
    strText = Content
 
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Const ForAppending = 8
 
    Set objTextFile = objFSO.OpenTextFile (strFile, ForAppending, True)
    objTextFile.WriteLine(strText)
    objTextFile.Close
 
    AcroAVDoc.Close True
    AcroApp.Exit
    Set AcroDoc = Nothing
    Set AcroApp = Nothing
    On Error GoTo 0
End Function

With this OLE object we can get below properties of PDF file
Time, show, minimize, maximize, hide, FindText, GetTitle, Open, Print size, showtextselect, GetPageNum, GetText, Getpage, Create, delete..etc)

Wednesday, 20 July 2016

Deleting Browser Temporary files, Cookies, History with QTP-VBScript

When we are executing end to end Automation scripts(from login to logoff) in batch mode, we may come across an issue in one of the scripts and script doesn't execute logoff functionality and hence next script tries to open browser and perform login functionality  whereas application retains the session we have used previously and directly opens home page by logged in already.

If we have not done exception handling on this are then there are lot of chances to get our next scripts fails in the batch and this is blocker for batch(night mode) execution

Below are the few options to resolve this issue.

Delete the browser history, temp files, cookies while launching browser always(you can include this in login functionality, so that this will always makes sure it don't retain previous session)

Though we perform above action, if still session is getting retained then we can implement logic in Login script to verify application is launched with login page or home page, if it is displayed home page then logoff and call the login functionality again.

Below are few options to delete Browser Temporary files, Cookies, History with QTP-VBScript

'Option 1:
ClearBrowserHistory
Function ClearBrowserHistory
Dim temp
Set fso = CreateObject ("Scripting.FileSystemObject")
Set winsh = CreateObject ("Wscript.Shell")
Set temp = fso.GetFolder (winsh.ExpandEnvironmentStrings("%TEMP%"))
On Error Resume Next

For each ofile in temp.Files
fso.DeleteFile ofile
Next

For Each osubfldr in temp.subfolders
fso.DeleteFolder (osubfldr),true
Next
wscript.quit
End Function

'Option 2:
Webutil.DeleteCookies

'To clear temporary Internet files
Set WShell = CreateObject("WScript.Shell")
WShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"

'To Clear Browsing History
WShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"

Wait (10)

'Option 3:
'To clear temporary Internet files
Set WshShell = CreateObject("WScript.Shell")
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"

'To clear browsing cookies
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2"

'To Clear Browsing History
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"

'Below are few more options to use
Browser("Browser Name").ClearCache
Browser("Google.com:").DeleteCookies "Google"
WebUtil.deletecookies '-> It will delete the entire cookies session which will present in your system.

Deleting Browser Temporary files, Cookies, History with QTP-VBScript

When we are executing end to end Automation scripts(from login to logoff) in batch mode, we may come across an issue in one of the scripts and script doesn't execute logoff functionality and hence next script tries to open browser and perform login functionality  whereas application retains the session we have used previously and directly opens home page by logged in already.

If we have not done exception handling on this are then there are lot of chances to get our next scripts fails in the batch and this is blocker for batch(night mode) execution

Below are the few options to resolve this issue.

Delete the browser history, temp files, cookies while launching browser always(you can include this in login functionality, so that this will always makes sure it don't retain previous session)

Though we perform above action, if still session is getting retained then we can implement logic in Login script to verify application is launched with login page or home page, if it is displayed home page then logoff and call the login functionality again.

Below are few options to delete Browser Temporary files, Cookies, History with QTP-VBScript

'Option 1:
ClearBrowserHistory
Function ClearBrowserHistory
Dim temp
Set fso = CreateObject ("Scripting.FileSystemObject")
Set winsh = CreateObject ("Wscript.Shell")
Set temp = fso.GetFolder (winsh.ExpandEnvironmentStrings("%TEMP%"))
On Error Resume Next

For each ofile in temp.Files
fso.DeleteFile ofile
Next

For Each osubfldr in temp.subfolders
fso.DeleteFolder (osubfldr),true
Next
wscript.quit
End Function

'Option 2:
Webutil.DeleteCookies

'To clear temporary Internet files
Set WShell = CreateObject("WScript.Shell")
WShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"

'To Clear Browsing History
WShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"

Wait (10)

'Option 3:
'To clear temporary Internet files
Set WshShell = CreateObject("WScript.Shell")
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"

'To clear browsing cookies
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2"

'To Clear Browsing History
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"