Author Topic: How to find out how many test steps got failed in each test cases associated wit  (Read 2987 times)

Offline Anil C

  • Full Member
  • ***
  • Posts: 104
  • simple
    • http://
Hi All,

Let’s say 5 test cases are linked with a requirement in QC, from requirement coverage analysis we can see failed test cases and passed test cases details

Imagine in one test case we have 500 test steps
How to find out how many test steps got failed in each test cases associated with this requirement coverage analysis view


Thanks

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 3029
    • KnowledgeInbox
Are you trying to find this out in QC itself or you want to write some code to do that?
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline Anil C

  • Full Member
  • ***
  • Posts: 104
  • simple
    • http://
Yes i am trying to find this out in QC itself ,seems this feature is not avaliable in QC
any idea how to do this by a program ?
« Last Edit: January 23, 2009, 03:59:11 am by Anil Chowdary »

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 3029
    • KnowledgeInbox
You can add a custom field to test lab. And the field can have the number of failed steps in last run. You need to do this with in QC Customization for auto update of the fields.
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline Anil C

  • Full Member
  • ***
  • Posts: 104
  • simple
    • http://
hi tarun,
any sample code on this?

Thanks

Offline Shiva kumar

  • Newbie
  • *
  • Posts: 35
  • I work for a software firm as a Assistant system engineer .
Hi Anil,

As you are looking to get the number of test steps failed in a latest test run i am providing this approach.

1.I added a button in the test lab module and associated an action to it.Now this button appears in the Test Lab module.you can do it in the customization window WorkFlow-->Script Editor -->Goto ToolBar Button Editor.

2.In the project Customization goto Setup WorkFlow-->Script Editor -->Goto Test Lab Node .

3.When you expand this node you will find TestLab_ActionCanExecute(ActionName) Node.
Now associate the button action which was created earlier to this node.You can do it this way.

                  Function TestLab_ActionCanExecute(ActionName)
                      On Error Resume Next
                         If ActionName = "Step_Summary" then
                             Call Steps_Failed   'This is a function call to other function where we are capturing the no.of steps failed.
                         End If
                       TestLab_ActionCanExecute = True
                       On Error GoTo 0
                 End Function


                  Public Function Steps_Failed

                     Set tdc = TDConnection
                     Set com = tdc.Command
                     com.CommandText = "Select MAX(RN_RUN_ID)from RUN"
                     Set RecSet = com.Execute
                     TestID = RecSet.FieldValue(0)
                     Set tdc1 = TDConnection
                     Set com1 = tdc1.Command
                     com1.CommandText = "SELECT Count(ST_STATUS) FROM STEP where ST_RUN_ID ="& TestID & " AND ST_STATUS = 'Failed'"
                     Set RecSet1 = com1.Execute
                     Msgbox  RecSet1.FieldValue(0)

                   End Function


When you click on the button it  gives a popup showing how many steps failed in the last run.As Tarun suggested you can associate it to a field in the test lab module.