You are on page 1of 9

OBIEE Regression

Testing
Asset to perform Regression test the OBIEE Code

Prepared by: Uttam Singh


Supervisor: Suman Gopalan

Table of Contents
I.

Objective .............................................................................................................. 2

II.

Description ........................................................................................................... 2
Tools used
Code
Runcat.bat
Creds.txt

III.

Prerequisites........................................................................................................ 4

IV.

Steps to follow ..................................................................................................... 5

V.

Contact Information ........................................................................................... 8

Objective
The data should arguably be what is most important to our users. If its wrong, thats
bad, and if its right, hopefully theyre going to be happy. Obviously, there are other
factors in making users happy not least performance and the visual appearance of the
data. But a system that gives users wrong data, or no data, is fundamentally a failed
one.
The BI Server responds to data requests (in the form of Logical SQL queries) is governed
by the RPD, the metadata model that abstracts the physical source(s) into a logical
Business model. Because of this abstraction it means that all Logical queries (i.e.
analysis/dashboard data requests) are compiled into Physical SQL for sending to the
data source(s) at runtime only. Whenever the RPD changes, the way in which any
logical query is handled may change.
The objective of this asset is to generate the Logical SQL of the reports before and
after the change in the RPD and compare for regression testing.

Description
If the Logical SQL remains the same (i.e. the analysis has not changed nor Presentation
Services binaries changed) and the data returned by the BI Server as a result of the
Logical SQL before and after the RPD change is made is the same then we can reason
that the resulting report shown to the user will remain the same.
Using this logic we can strip away the top layer of testing (trying to detect if a web
page matches another) and test directly against the data without having to actually run
the report itself.

Tools used
Batch Script with the command for generating the Logical SQL Files
OBIEE Catalog Manager command utility runcat.cmd present in
\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\catalogmanager

Code

Runcat.bat

This code calls the Catalog Manager Command utility and generates the Logical SQL for the Analysis.

This code needs to be run twice before and after the code change.

Change the forceOutputFile name in the batch file to a logical name before running it.

cd
C:\OBIEE_11g\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\catalogmanager
start runcat.cmd -cmd report -online http://mw7fbf1tnqpgqx:7001/analytics/saw.dll -credentials creds.txt -forceOutputFile
c:/ORT/Beforeoutput1.lsql -folder "/users/utsingh/Cox Data Lineage/COX Data Lineage - Reports by Folder" -type "Analysis" fields "SQL"

Output: Logical SQL File


SQL
SELECT 0 s_0, "Cox Data Lineage"."Dashboard"."Dashboard Path" s_1, "Cox Data Lineage"."Metrics - Dashboard"."#
Dashboards" s_2 FROM "Cox Data Lineage" ORDER BY 1, 2 ASC NULLS LAST FETCH FIRST 65001 ROWS ONLY

Creds.txt

This code stores the DB Credentials for connecting to the OBIEE folder where the report is stored.

Make sure this user has access to the reports present in the folder.

login=<username>
pwd=<password>

Prerequisites

Make sure the OBIEE services are running where the code is being executed.

Make sure the user running the report has permission to the folder where the report is
present.

Steps to follow

1. Create a folder for keeping all code together.


2. Place the creds.txt under
\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\catalogmanager

3. Find the list of reports with their path. e.g., /users/utsingh/Cox Data Lineage/COX Data Lineage - Report
4. Create a batch script with the code for each report whose Logical SQL needs to be generated. e.g.,
start runcat.cmd -cmd report -online http://mw7fbf1tnqpgqx:7001/analytics/saw.dll -credentials creds.txt -forceOutputFile
c:/ORT/Beforeoutput1.lsql -folder "/users/utsingh/Cox Data Lineage/COX Data Lineage - Report" -type "Analysis" -fields "SQL"
start runcat.cmd -cmd report -online http://mw7fbf1tnqpgqx:7001/analytics/saw.dll -credentials creds.txt -forceOutputFile
c:/ORT/Beforeoutput2.lsql -folder "/users/utsingh/Cox Data Lineage/COX Data Lineage - Element Count by Subject Area" -type
"Analysis" -fields "SQL"

5. Run the batch file.


Output:

6. The above step will generate the Logical SQLs for two reports in the path provided under forceOutputFile
argument.

7. Make the change in the RPD and deploy the code to check if any regression occurred for the two reports.
8. Open the batch file Runcat.bat and change the -forceOutputFile location to a logical name, e.g.,
AfterChange.sql

9. Run the Runcat.bat file to create the next set of logical sql files after the code change in the RPD.
10. Create a batch file for comparing the two logical SQL file. e.g.,

COMP c:\ORT\BeforeChange1.lsql c:\ORT\AfterChange1.lsql /a /l /n


COMP c:\ORT\BeforeChange2.lsql c:\ORT\AfterChange2.lsql /a /l /n
pause
Output:

11. If there is a difference in the code it will say Files are difference sizes. If there is no change it will say Files
compare OK.

12. The output can be changed to generate the difference in a different manner.

The Logical SQL can be obtained from Usage Tracking, for example:
SELECT QUERY_TEXT FROM S_NQ_ACCT WHERE START_TS > SYSDATE - 7
or you can take it directly from the nqquery.log. For more than a few analyses, Usage Tracking is definitely the
more practical option.

Contact Information

Uttam Singh
Suman Gopalan

Team Lead
Associate Manager

Uttam.singh@accenture.com
Suman.gopalan@accenture.com

You might also like