Top Banner
Importing all the Test Cases From a Test Set Folder of Quality Center To Excel By Vinod Kumar Marothy 04-Dec-2009
18

Importing All the Test Cases From a Test Folder to Excel

Dec 17, 2015

Download

Documents

samalpartha

Importing All the Test Cases From a Test Folder to Excel
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • Importing all the Test Cases

    From a Test Set Folder of Quality Center

    To Excel

    By

    Vinod Kumar Marothy

    04-Dec-2009

  • Excel Report Generator

    You can generate Excel reports that enable you to export Quality Center data like Requirements,

    Test Cases, and Defects etc to Microsoft Excel.

    Currently our focus is on generating a report that imports the Test Cases from Quality Centre to

    Microsoft Excel in one shot. Following is the procedure for the same.

    Launching 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.

  • Below Excel Report Generator window pops up

  • Creating Excel Reports

    For Creating Excel Reports we have to do the following

    - Add Report - Create SQL query - Generate Report

    Adding Report

    - 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 creates it.

    - Clicking on the New Excel Report button opens a New Excel Report dialog box.

    - Type a name for your report in the Excel Report Name edit box, and click OK. Note that a report name cannot include the following characters: / \ ? * = < > | : . " ' %.

    (For ex: Enter Excel Report Name as Importing Test Cases)

  • Following are two drop downs available in the right side frame of the Excel Report Generator

    - In the Designer drop down, by default it will display your name. You can also select the name of the report designer from the drop down.

    - In the Status drop down, select the status of your report.

    The report status informs other users whether the report is ready to be generated if you are

    creating the Excel Report in Public. Following are the two drop down values available for

    the report status

    Ready - Indicates that the report is ready to generate.

  • Not Ready - Indicates that the report is not ready to generate. If a user tries to generate a

    report with this status, a warning message displays.

    If you click Yes, in the Confirm pop up, it will display a dialogue box to save the Excel by

    browsing the location on your machine.

    If you select the location and click Save, it will display the below pop up

  • If you click No in the Confirm pop up, it will close the pop up.

    - In the Description edit box, type a description about your report. You can format the text that you described using the options in the Format Toolbar. If this toolbar is not available,

    right-click in the Description area and select the required Format option.

  • Creating SQL Queries

    After adding a report to the Excel Reports tree, you need to create an SQL query to extract the

    data from the required Test Folder.

    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:

    - In the Excel Reports tree, select a report and click on Query tab in the right side main frame

    - In the SQL pane, type an SQL statement to define the data set you want to use for your report.

  • Notes:

    - You need to write the SQL statement depending upon the DB type. To view the DB type,

    click the Database Type button .

    - The @ and \ characters are reserved character and could not use them directly in the SQL queries. If you need to use these characters, it should be prefixed by \.

    Eg. \@ and \ by \\.

    Following are the options available to add a project entity to SQL statement.

    - 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.

    Click Run Query to view all the results of the query in the Query Results tab. If the

    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.

    To add a new query, click the Add Query button . A new tab to the SQL pane with the

    default name Sheet will be added. The results from each query will be displayed in a

    separate Excel worksheet.

    To rename a query, select the query and click the Rename button . Alternatively, right-click

    the query and choose Rename.

    To delete a query, select the query and click the Delete button . Alternatively, right-click the

    query and choose Delete. Click yes to confirm.

  • Example for writing SQL Query in detail:

    Let me illustrate with an example.

    Lets import the test cases present in the Test Set Folder QB TD # 3806 Add default sele.

  • First try to find out the last most child ID of the test set folder from where to import all the Test

    Cases to Excel by executing the SQL queries in the following manner.

    - Select AL_FATHER_ID,AL_ITEM_ID,al_description from all_lists

  • - Select AL_FATHER_ID,AL_ITEM_ID,al_description

    from all_lists

    where al_father_id=3292

  • - Select AL_FATHER_ID,AL_ITEM_ID,al_description

    from all_lists

    where AL_FATHER_ID=8211

  • - Select AL_FATHER_ID,AL_ITEM_ID,al_description

    from all_lists

    where AL_FATHER_ID=8212

  • - SELECT

    ALL_LISTS.AL_DESCRIPTION /*Test Plan Folder.Name*/as Test_Folder_Name,

    TEST.TS_NAME /*Test.Test Name*/ as Test_Case_Name,

    TEST.TS_DESCRIPTION /*Test.Description*/ as Scenario,

    DESSTEPS.DS_STEP_NAME /*Design Step.Step Name*/ as Step_Name,

    DESSTEPS.DS_DESCRIPTION /*Design Step.Description*/ as Description,

    DESSTEPS.DS_EXPECTED /*Design Step.Expected Result*/ 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_ITEM_ID = 8213

  • If you want to import the test cases from more than one test set, append the next test set

    ALL_LISTS.AL_ITEM_ID with AND statement to the above SQL query.

    - SELECT

    ALL_LISTS.AL_DESCRIPTION /*Test Plan Folder.Name*/as Test_Folder_Name,

    TEST.TS_NAME /*Test.Test Name*/ as Test_Case_Name,

    TEST.TS_DESCRIPTION /*Test.Description*/ as Scenario,

    DESSTEPS.DS_STEP_NAME /*Design Step.Step Name*/ as Step_Name,

    DESSTEPS.DS_DESCRIPTION /*Design Step.Description*/ as Description,

    DESSTEPS.DS_EXPECTED /*Design Step.Expected Result*/ 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_ITEM_ID = 8213

    AND ALL_LISTS.AL_ITEM_ID = 8294

    Likewise we can generate reports by writing different SQL Queries for Requirements, Test

    Cases, and Defects etc to Microsoft Excel by using different column values present in each in-

    built tables.

  • Example to generate Bug Report

    Execute the below SQL query and get the required Bug Report

    - Select BUG.BG_BUG_ID /*Defect.Defect ID*/ "Defect_ID",

    BUG.BG_SUMMARY /*Defect.Summary*/ "Summary",

    BUG.BG_STATUS /*Defect.Status*/ "Status",

    BUG.BG_USER_08 /*Defect.SubTrack*/ "Sub_Track"

    FROM BUG /*Defect*/

    WHERE BUG.BG_USER_08='QB' ORDER BY BUG.BG_BUG_ID

  • Generating Excel Report

    Click General Setting tab and specify the path where to save the generated Excel Report as

    shown in the figure below.

    In our example I have specified the path to save the report on the Desktop.

    Click Generate Excel Report button as shown in the figure below.

    Excel report will be generated and saved with all the test cases on the desktop.