SQL Query to extract number of times a testcase is executed with each status

Hi,

I am looking for a sql query by which i can pull a test lab report with not only the latest run status but also all previous runs status. Kindly help me out.

Tags:

  • Does following sql help?

    If you want to get runs from test case view:

    SELECT TS_NAME, RN_RUN_NAME, RN_EXECUTION_DATE, RN_STATUS FROM RUN inner join TEST on RN_TEST_ID= TS_TEST_ID where TS_TEST_ID=1 order by TS_TEST_ID, RN_TESTCYCL_ID, RN_EXECUTION_DATE

    if you want to get runs from test lab view:

    SELECT TS_NAME, RN_EXECUTION_DATE, RN_STATUS FROM RUN inner join TESTCYCL on RN_TESTCYCL_ID=TC_TESTCYCL_ID inner join TEST on TC_TEST_ID=TS_TEST_ID where RN_CYCLE_ID=1 order by RN_CYCLE_ID, RN_TESTCYCL_ID, RN_EXECUTION_DATE
    

    Please change the where condition accordingly.

  • Hi Tina,

    Thanks for sharing the query. I am unable to extract test lab report using below query. Could you please share query to extract using path from test lab

  • How about this query?

    SELECT TS_NAME, RN_STATUS, COUNT(1) STATUS_TIME FROM RUN 
    inner join TESTCYCL on RN_TESTCYCL_ID=TC_TESTCYCL_ID 
    inner join TEST on TC_TEST_ID=TS_TEST_ID 
    GROUP BY TS_NAME, RN_STATUS
    ORDER BY TS_NAME