Sei sulla pagina 1di 17

Importing Test Cases from QC to Excel Sheet

Importing Test Cases from Quality Centre to Excel in one shot


You can generate Excel reports that enable you to export Quality Center data like
Requirements, Test Cases, Defects etc to Microsoft Excel and analyze the data from
within Excel.
Currently our focus is on generating a report that imports the Test Cases from Quality
Centre to Microsoft Excel. Below is the procedure for the same.

Launching The Excel Report Generator


You create, generate, and manage reports in the Excel Report Generator. To open the
Excel Report Generator, click the Tools button on the upper-right of the Quality Center
window, and select Excel Report Generator.

Creating Excel Reports


For Creating Excel Reports we have to do the following
1. Add Report
2. Create SQL query
3. Generate Report
Adding Report
1. In the Excel Reports tree, select the folder in which you want to create the report:
The folders available are Public and Private. If a report is created under Public
folder it will be available to all the users of the project. The reports under private
folder are available only to the user who created it.
2. Click the Add excel Report button and the New Excel Report dialog box opens

3. In the Excel Report Name box, type a name for your report and click OK. Note
that a report name cannot include the following characters: / \ ? * = < > | : . " ' %.
(for ex: Enter Excel Report Name as Test Script Export Procedure)

4. Click the General tab. The General tab displays general settings for the report.

1. In the Designer box, select the name of the report designer. By default, your
user name is displayed.
2. In the Status box, select the status of your report.
The report status informs other users whether the report is ready to generated. The
following options are available for the report status:
Ready. Indicates that the report is ready to be generated. Not Ready. Indicates that
the report is not ready to be generated. If a user tries to generate a report with this
status, a warning message displays.
3. In the Description box, type a description for your report. You can change how
the description is formatted using the options in the formatting toolbar. If this
toolbar is not available, right-click the Description box and select Toolbar
Visible

Creating SQL Queries


After you have added a report to the Excel Reports tree, you must define which project
data you want to include in the report. You define this data by creating SQL queries to
extract the data.
The Quality Centre allows us to run only such queries that do not alter or modify the data
of the project data base
To create an SQL query:
1. In the Excel Reports tree, select a report. Click the Query tab

2. In the SQL pane, type an SQL statement to define the data set you want to use
for your report.
Notes:
You must write the SQL statement using the version of SQL used by the project
database. To view the database type used for your project database, click the

Database Type button


.
The @ and \ characters have a special meaning and are not read literally when
running SQL statements on the project database. If you want these characters to be
read literally, you should replace @ by \@ and \ by \\. For example, if you want the
statement
SELECT * FROM BUG WHERE BUG.BG_SUMMARY = `@parameter@'
to be run literally on the Quality Center database, type
SELECT * FROM BUG WHERE BUG.BG_SUMMARY = `\@parameter\@'.
You can add a project entity to your SQL statement. The following options are
available:

To add a project entity without a column alias, double-click an entity in


the Entities pane, or select an entity and click the Add Entity to Query
button

To add a project entity with the column alias defined by the entity title,
select the entity you want to add. Click the Add Entity to Query arrow
and choose Add Entity to Query with Entity Title as Alias.

You can test the query and view the results of the test in the Query Results tab. You can
choose to view all the results of the query or only the first ten records:
Click Run Query to view all the results of the query in the Query Results tab. If your
query contains parameters, you are asked to type a value for each parameter, or confirm
the default value.
Click Test Query to display only the first ten records from the results of the query. If
your query contains parameters, Quality Center uses the default values for the
parameters.
To add a new query, click the Add Query button
. The query is added as a new tab to
the SQL pane with the default name Sheet<number>. The results from each query will
be displayed in a separate Excel worksheet.
You can rename a query. To rename a query, select the query and click the Rename
button . In the Rename Sheet Name dialog box, type the new name and click OK. The
Excel worksheet containing the data extracted by the query will have the same name as
the query.
To delete a query, select the query and click the Delete button
click the query and choose Delete. Click yes to confirm.

. Alternatively, right-

Example for writing SQL Query in detail:


Write below mentioned SQL Query in Query tab.
Select AL_FATHER_ID,AL_ITEM_ID,al_description from all_lists
And Click on Run Query tab present just below the Query tab.
Results will be displayed in Query Results tab as shown in below fig.

In Query Results check al_description column and verify that all folders created for
each projects in Test Plan will be displayed. Select your required project folder and note
down the AL_ITEM_ID value for that folder. If the folder doesnt contains any subfolder
then directly write below SQL Query to get the results.
Select AL_FATHER_ID,AL_ITEM_ID,al_description from all_lists where
al_father_id=1547
Click on Run Query tab to get the results.
(Note: 1547 is the item id for the project 3GCS QA Concord).

If selected folder has sub folders then we have to write SQL Query so that we have to get
item_id for the last required sub folder.
In Query Results (displayed in above fig) for the project 3GCS QA Concord, it will be
displayed all subfolders. In the sub folders list, we have to select the required sub folder
(for ex: Siebel Regression Repository NEW). Note down AL_ITEM_ID and write SQL
Query as mentioned below.
For Ex: Select AL_FATHER_ID,AL_ITEM_ID,al_description from all_lists where
al_father_id=9863
Click on Run Query tab to get the results.

Here again Business Process Scripts, Functional Scripts, Scripts Deleted and Scripts
Removed are again subfolders in Siebel Regression Repository NEW folder. Select
required sub folder (for ex: Business Process Scripts). Note down AL_ITEM_ID and
write SQL Query as mentioned below.
SELECT all_lists.al_description as Folder_Name,TEST.TS_NAME as Test_Name,
TEST.TS_DESCRIPTION as Description, DESSTEPS.DS_STEP_NAME as Step_Name
, DESSTEPS.DS_DESCRIPTION as Description, DESSTEPS.DS_EXPECTED as
Expected_Result
FROM TEST, DESSTEPS /*Design Step*/ , ALL_LISTS /*Test Plan Folder*/
Where DESSTEPS.DS_TEST_ID /*Design Step.Test ID*/ = TEST.TS_TEST_ID
/*Test.Test ID*/
AND TEST.TS_SUBJECT =ALL_LISTS.AL_ITEM_ID /*Test Plan Folder.Item
Id*/
and ALL_LISTS.AL_FATHER_ID /*Test Plan Folder.Father Id*/ =9864

Click on Run Query tab to get the results.

More Explanations about SQL Query column fields:


Whenever we are going to create new report, by default all tables (in-built) having
column values are displayed at right side of the.
In above mentioned SQL Query we have used different column values from the 3
different tables named Design Step (DESSTEPS), Test (TEST) and Test Plan Folder
(ALL_LISTS).
From the Design Step (DESSTEPS) table we have used below mentioned columns:
Step Name (DS_STEP_NAME), Description (DS_DESCRIPTION) and Expected Result
(DS_EXPECTED).
From the Test (TEST) table we have used below mentioned columns:
Test Name (TS_NAME) and Description (TS_DESCRIPTION)

And from the Test Plan Folder (ALL_LISTS) table we have used below mentioned
column:
Name (AL_DESCRIPTION)

Example for generating Bug Report:


Write SQL Query in Query tab:
Select BUG.BG_BUG_ID as 'Defect Id', /*Defect.Defect ID*/ BUG.BG_SUMMARY as
Summary, /*Defect.Summary*/ BUG.BG_STATUS as Status /*Defect.Status*/ from
BUG where BG_PROJECT like 'Service On%' and BG_DETECTION_VERSION =
'Release 2.00'
Click on Run Query tab to get the results.

Like wise we can generate reports by writing different SQL Queries for Requirements,
Test Cases, Defects etc to Microsoft Excel by using different column values present in
each in-built tables.

Generating Reports
After you have created your report, you can generate the report to extract the data you
specified in the SQL queries from the project database and export it to Excel.

To generate a report:
1. In the Excel Reports tree, select a report. Click the Generation Settings tab.

2. If you want Quality Center to open the report in Excel after it is generated, select
the Open Report check box.
1. In the Save report as target file box, type the location and name of the Excel file to
which you want the data to be exported. You can click the browse button to select a
location from the Save Report dialog box.
2. Click the Generate Excel Report button

to generate the report.

If the status of the report is Not Ready, you are informed of this and asked if you want to
generate the report anyway. Click Yes to generate the report.
Or Click on No. Select value as Ready from the Status dropdown in General Tab and
click on Generate Excel Report button
to generate the report. It will open Save
Report dialog box. Click on Save button to save the file in required path.

If the report query contains parameters, the Report Parameters dialog box opens. Type the
parameter values in the Value column and click OK.

The report is saved in the location you defined. If you chose to open the report after it is
generated, Excel opens and displays the report. If you did not choose to open the report
after it is generated, a confirmation message displays.

Conclusion:
This tool is very helpful for taking backup for all the test plans which are there in Quality
Center. This Test plan repository is quite helpful in adhering to the deliverables schedule
when the Quality Center server is down. This setup is quite useful when the user works
with the Global Delivery Model. It also saves the effort of uploading the Test Plan to
Quality Center as it automates the same.

Potrebbero piacerti anche