Lieutenant
Lieutenant
438 views

data driven tests not displayed in the report

Greetings

 

I have an execution plan with 5 tests, out of which one is a data driven test that has 5 scenarios below it. In silk central> data tab, I am only seeing 4 non data driven tests (TestDefId,) I am trying to generate a report with the below query. I am seeking help to be able to retrieve the data driven test as well as part of the sql.

 

select
            etn.NodeID_pk ExecDefId,
            etn.NodeName ExecDefName,
            tpn.NodeID_pk TestDefId,
           tpn.Name TestDefName,
            tdeds.PassedCount,
            tdeds.FailedCount,
            tdeds.NotExecutedCount,
            tdeds.TestDefExecID_fk TestDefRunId,
            tdeds.IsLeaf,
            tdCount.NrAssignedTestDefs,
            count(tpn.NodeID_pk) over (partition by etn.NodeID_pk) NrNotPassedTestDefs,
            etn.ProjectID_fk ProjectId,
                    ttde.RunComment
                             
          from TM_ExecTreeNodes etn
            inner join TM_ExecTreePaths etp on etn.NodeID_pk = etp.NodeID_pk_fk
            inner join TM_V_ExecNodes_TestDefs entd on entd.ExecNodeID = etn.NodeID_pk
            inner join TM_TestPlanNodes tpn on tpn.NodeID_pk = entd.TestDefID_pk_fk
            left join TM_TestDefExecDefStatuses tdeds on tdeds.TestPlanNodeID_pk_fk = entd.TestDefID_pk_fk and tdeds.ExecTreeNodeID_pk_fk = etn.NodeID_pk
            inner join (select entd2.ExecNodeID, count(*) NrAssignedTestDefs
                        from TM_V_ExecNodes_TestDefs entd2 where entd2.PositionNumber >= 0
                        group by entd2.ExecNodeID) tdCount on tdCount.ExecNodeID = etn.NodeID_pk
                    inner join TM_TestDefExecutions ttde on TestDefExecID_pk_fk = tdeds.TestDefExecID_fk
                                              
          where tpn.ProjectID_fk = ${$PROJECTID}  AND etp.ParentNodeID_pk_fk = ${execNode_Id_0|832|ExecNodeID} 
            and etn.IsLeaf = 1
            and entd.PositionNumber >= 0
            and (tdeds.FailedCount > 0 or tdeds.PassedCount > 0 or tdeds.ExecutionTimestamp IS NULL)

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Hi @rekhasunkara1,

 

You have to LEFT JOIN TM_TestDefExecutions instead of INNER JOIN. This is because for non-atomic datadriven tests the results are assigned to the child nodes. See the complete SQL below:

 

SELECT etn.NodeID_pk ExecDefId, etn.NodeName ExecDefName, tpn.NodeID_pk TestDefId, tpn.Name TestDefName, tdeds.PassedCount, tdeds.FailedCount, tdeds.NotExecutedCount, tdeds.TestDefExecID_fk TestDefRunId, tdeds.

 IsLeaf, tdCount.NrAssignedTestDefs, count(tpn.NodeID_pk) OVER (PARTITION BY etn.NodeID_pk) NrNotPassedTestDefs, etn.ProjectID_fk ProjectId, ttde.RunComment

FROM TM_ExecTreeNodes etn

INNER JOIN TM_ExecTreePaths etp ON etn.NodeID_pk = etp.NodeID_pk_fk

INNER JOIN TM_V_ExecNodes_TestDefs entd ON entd.ExecNodeID = etn.NodeID_pk

INNER JOIN TM_TestPlanNodes tpn ON tpn.NodeID_pk = entd.TestDefID_pk_fk

LEFT JOIN TM_TestDefExecDefStatuses tdeds ON tdeds.TestPlanNodeID_pk_fk = entd.TestDefID_pk_fk

 AND tdeds.ExecTreeNodeID_pk_fk = etn.NodeID_pk

INNER JOIN (

 SELECT entd2.ExecNodeID, count(*) NrAssignedTestDefs

 FROM TM_V_ExecNodes_TestDefs entd2

 WHERE entd2.PositionNumber >= 0

 GROUP BY entd2.ExecNodeID

 ) tdCount ON tdCount.ExecNodeID = etn.NodeID_pk

LEFT JOIN TM_TestDefExecutions ttde ON TestDefExecID_pk_fk = tdeds.TestDefExecID_fk

WHERE tpn.ProjectID_fk = ${ $PROJECTID}

 AND etp.ParentNodeID_pk_fk = ${ execNode_Id_0 | 832 | ExecNodeID}

 AND etn.IsLeaf = 1

 AND entd.PositionNumber >= 0

 AND (

  tdeds.FailedCount > 0

  OR tdeds.PassedCount > 0

  OR tdeds.ExecutionTimestamp IS NULL

  )

 

 

Regards,

Hubert

 

Lieutenant
Lieutenant

Excellent!!!....Thank you so much for a quick reply. Saved my day

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.