Highlighted
sadheesh Absent Member.
Absent Member.
1349 views

How to download the test cases from Test Lab in HP ALM.

Hi,

 

I need to download the test cases from a particular folder in Test Lab in ALM. Can you please help to provide the process / query for this?

 

0 Likes
6 Replies
Damodar-Reddy Acclaimed Contributor.
Acclaimed Contributor.

Re: How to download the test cases from Test Lab in HP ALM.

Usefull Post.

http://community.hpe.com/t5/Quality-Center-ALM-Practitioners/Need-SQL-Query-for-Test-plan-module/td-p/6884826

This is for Test Plan:

The below Query may be useful in extracting all the data, may be you can filter out for your requirement.

SELECT
c.CY_CYCLE as "Test Set",
c.CY_CYCLE_ID as "Test Set ID",
e.CF_ITEM_NAME as "Test set Folder Name",
e.CF_ITEM_ID as "Folder ID",
T.TS_TEST_ID as "Test ID",
t.TS_NAME as "Test Name",
r.RN_RUN_ID as "Latest Run ID",
f.TC_STATUS as "Status",
r.RN_STATUS as "Last Run Status",
r.RN_TESTER_NAME as "Tester"
from CYCLE c, RUN r , TEST t , CYCL_FOLD e, TESTCYCL f
where c.CY_FOLDER_ID = e.CF_ITEM_ID
and e.CF_ITEM_PATH like 'AAAAAGAAB%'
and f.TC_STATUS = 'Passed'
and t.TS_TEST_ID = f.TC_TEST_ID
and t.TS_TEST_ID = r.RN_TEST_ID
and f.TC_CYCLE_ID = r.RN_CYCLE_ID
and r.RN_CYCLE_ID = c.CY_CYCLE_ID
and r.RN_TESTCYCL_ID = f.TC_TESTCYCL_ID
and r.RN_RUN_ID in

( SELECT MAX(r.RN_RUN_ID) as RN_RUN_ID from RUN r , TEST t , CYCL_FOLD e

where c.CY_FOLDER_ID = e.CF_ITEM_ID
and e.CF_ITEM_PATH like 'AAAAAGAAB%'
and t.TS_TEST_ID = r.RN_TEST_ID
and r.RN_CYCLE_ID = c.CY_CYCLE_ID

Group by
r.RN_CYCLE_ID,
t.TS_TEST_ID)
(If this helped, accept as solution )
(Posts and opinions made here are my own and do not reflect the opinions of my employer)
0 Likes
sadheesh Absent Member.
Absent Member.

Re: How to download the test cases from Test Lab in HP ALM.

Hello Damus,

Thanks for your reply. Query is working fine from test lab and it gives all the test run results along with the Test ID.

Can you please provide the query to get all the test cases along with the test steps (Description, Expected and Actual Result) from the particular Folder in Test Lab.

 

 

0 Likes
irtuk Outstanding Contributor.
Outstanding Contributor.

Re: How to download the test cases from Test Lab in HP ALM.

Try this Sadheesh,

 

It brings back a few too many columns for my liking and I have hacked out the reference to the specific test case folder that Damus had, and added a couple of columns to his query to join mine onto but other than that this should do the job for you.

select * from (

SELECT
c.CY_CYCLE as "Test Set",
c.CY_CYCLE_ID as "Test Set ID",
e.CF_ITEM_NAME as "Test set Folder Name",
e.CF_ITEM_ID as "Folder ID",
T.TS_TEST_ID as "Test ID",
t.TS_NAME as "Test Name",
r.RN_RUN_ID as "Latest Run ID",
f.TC_STATUS as "Status",
r.RN_STATUS as "Last Run Status",
r.RN_TESTER_NAME as "Tester" ,
r.RN_RUN_ID,
s.ST_ID
from CYCLE c, RUN r , TEST t , CYCL_FOLD e, TESTCYCL f, STEP s

where c.CY_FOLDER_ID = e.CF_ITEM_ID
--and e.CF_ITEM_PATH like 'AAAAAGAAB%'
and f.TC_STATUS = 'Passed'
and t.TS_TEST_ID = f.TC_TEST_ID
and t.TS_TEST_ID = r.RN_TEST_ID
and f.TC_CYCLE_ID = r.RN_CYCLE_ID
and r.RN_CYCLE_ID = c.CY_CYCLE_ID
and r.RN_TESTCYCL_ID = f.TC_TESTCYCL_ID
and r.RN_RUN_ID = s.ST_RUN_ID
and r.RN_RUN_ID in

( SELECT MAX(r.RN_RUN_ID) as RN_RUN_ID from RUN r , TEST t , CYCL_FOLD e

where c.CY_FOLDER_ID = e.CF_ITEM_ID
--and e.CF_ITEM_PATH like 'AAAAAGAAB%'
and t.TS_TEST_ID = r.RN_TEST_ID
and r.RN_CYCLE_ID = c.CY_CYCLE_ID

Group by
r.RN_CYCLE_ID,
t.TS_TEST_ID) ) DAMUS

inner join
(
SELECT
ts_test_id,
ts_name,
ds_step_order,
ds_description,
ds_expected,
st_actual,
rn_run_id,
st_id
FROM test
inner join dessteps on ds_test_id = ts_test_id
inner join testcycl on tc_test_id = ts_test_id
inner join step on ds_id = st_id
inner join run on rn_run_id = st_run_id
) IRTUK on DAMUS.rn_run_id = IRTUK.rn_run_id AND DAMUS.ST_ID = IRTUK.st_id

Edward Moore
______________________________________________________________
Please mark this post as "accepted solution" if it solves your problem and don't forget to add KUDOS!
Damodar-Reddy Acclaimed Contributor.
Acclaimed Contributor.

Re: How to download the test cases from Test Lab in HP ALM.

Haha,

Nice one Ed...!!

(If this helped, accept as solution )
(Posts and opinions made here are my own and do not reflect the opinions of my employer)
0 Likes
irtuk Outstanding Contributor.
Outstanding Contributor.

Re: How to download the test cases from Test Lab in HP ALM.

Yeah I thought I had better credit the main part of that query to you 🙂

Edward Moore
______________________________________________________________
Please mark this post as "accepted solution" if it solves your problem and don't forget to add KUDOS!
0 Likes
Anthony_Pham
New Member.

Re: How to download the test cases from Test Lab in HP ALM.

Dear Irtuk,

Thanks a lot for your SQL query. However I have an empty Excel. What I did is, I just put my CF_ITEM_PATH value in your code and remove the comment quotes as below. Could you please advise and help?


select * from (

SELECT
c.CY_CYCLE as "Test Set",
c.CY_CYCLE_ID as "Test Set ID",
e.CF_ITEM_NAME as "Test set Folder Name",
e.CF_ITEM_ID as "Folder ID",
T.TS_TEST_ID as "Test ID",
t.TS_NAME as "Test Name",
r.RN_RUN_ID as "Latest Run ID",
f.TC_STATUS as "Status",
r.RN_STATUS as "Last Run Status",
r.RN_TESTER_NAME as "Tester" ,
r.RN_RUN_ID,
s.ST_ID
from CYCLE c, RUN r , TEST t , CYCL_FOLD e, TESTCYCL f, STEP s

where c.CY_FOLDER_ID = e.CF_ITEM_ID
and e.CF_ITEM_PATH like 'AAAADYAABAAA'
--and f.TC_STATUS = 'Passed'
and t.TS_TEST_ID = f.TC_TEST_ID
and t.TS_TEST_ID = r.RN_TEST_ID
and f.TC_CYCLE_ID = r.RN_CYCLE_ID
and r.RN_CYCLE_ID = c.CY_CYCLE_ID
and r.RN_TESTCYCL_ID = f.TC_TESTCYCL_ID
and r.RN_RUN_ID = s.ST_RUN_ID
and r.RN_RUN_ID in

( SELECT MAX(r.RN_RUN_ID) as RN_RUN_ID from RUN r , TEST t , CYCL_FOLD e

where c.CY_FOLDER_ID = e.CF_ITEM_ID
and e.CF_ITEM_PATH like 'AAAADYAABAAA'
and t.TS_TEST_ID = r.RN_TEST_ID
and r.RN_CYCLE_ID = c.CY_CYCLE_ID

Group by
r.RN_CYCLE_ID,
t.TS_TEST_ID) ) DAMUS

inner join
(
SELECT
ts_test_id,
ts_name,
ds_step_order,
ds_description,
ds_expected,
st_actual,
rn_run_id,
st_id
FROM test
inner join dessteps on ds_test_id = ts_test_id
inner join testcycl on tc_test_id = ts_test_id
inner join step on ds_id = st_id
inner join run on rn_run_id = st_run_id
) IRTUK on DAMUS.rn_run_id = IRTUK.rn_run_id AND DAMUS.ST_ID = IRTUK.st_id
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.