Skip to content

WAAT using Omniture Debugger

anandbagmar edited this page Jul 22, 2011 · 2 revisions

Approach

The Omniture Debugger works by executing a javascript (provided by Omniture SiteCatalyst) in the same browser where your UI test is executing. This action opens a new window and shows the list of name/value pair properties reported to SiteCatalyst. This approach makes used of the UI framework being used. To use WAAT in this approach, you need to follow the steps mentioned below.

Create an implementation of the ScriptRunner interface

Your test framework could be using any of the available UI drivers (example: Selenium, WebDriver, Sahi, etc.). To work with WAAT, you will first need to implement a ScriptRunner class. This class provides a hook for the WAAT framework to execute the javascript in the currently executing browser instance to open, and capture the data being sent to SiteCatalyst.

Selenium and WebDriver sample script runners are provided with the WAAT distribution. See the SeleniumScriptRunner.java and WebDriverScriptRunner.java files in folder - \samplescripts\com\thoughtworks\webanalyticsautomation\scriptrunner in the downloaded zip distribution for reference.

Copy the relevant ScriptRunner file in your test framework, update its namespace and your ScriptRunner class is ready for use.

Selenium ScriptRunner

  • Copy the SeleniumScriptRunner.java from \samplescripts\com\thoughtworks\webanalyticsautomation\scriptrunner in the downloaded zip file to your test framework,
  • Update its namespace
  • Your ScriptRunner class is ready for use.

WebDriver ScriptRunner

  • Copy the WebDriverScriptRunner.java from \samplescripts\com\thoughtworks\webanalyticsautomation\scriptrunner in the downloaded zip file to your test framework,
  • Update its namespace
  • Your ScriptRunner class is ready for use.

Other ScriptRunner

If you are using any other UI testing framework, you can create a class similar to the SeleniumScriptRunner.java or WebDriverScriptRunner.jar by implementing the com.thoughtworks.webanalyticsautomation.scriptrunner.ScriptRunner interface.

Define Test data

Provide the test data to be validated for each action in an xml file. Sample XML file is provided here.

Test code changes

You will need to make changes in your existing / new tests. See the Omniture-Debugger:-Selenium-based-test-changes and Omniture-Debugger:-WebDriver-based-test-changes sections for sample changes required.