SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Caculate Pass rate through script

    I just add a toolbar button in the Test Lab.
    When click the button, the pass rate and execution rate for current test set will be calculated.

    Here is the code I'm using:

    Sub Calculate_Pass_Rate
    cyId = TestSet_Fields("CY_CYCLE_ID").Value 'CY_CYCLE_ID the ID of test set record'

    selectSql = "SELECT COUNT(*) FROM TESTCYCL where TC_CYCLE_ID = '" & cyId & "' and TC_STATUS "
    'TC_CYCLE_ID: CYCLE.CY_CYCLE_ID of the test set containing this test.'

    Set tdc = TDConnection
    Set com = tdc.Command
    com.CommandText = selectSql & "= 'Passed'"
    'Msgbox "com.CommandText is: " & com.CommandText
    Set RecSet = com.Execute
    passCount = RecSet.FieldValue(0)
    'Msgbox "Passed count is: " & passCount

    Set com1 = tdc.Command
    com1.CommandText = selectSql & "IN('Passed','Failed','No Run','Not Completed')"
    Set RecSet1 = com1.Execute
    totalCount = RecSet1.FieldValue(0)
    'Msgbox "Total count is: " & totalCount

    Set com2 = tdc.command
    com2.CommandText = selectSql & "IN('Passed','Failed')"
    Set RecSet2 = com2.Execute
    ExecuteCount = RecSet2.FieldValue(0)
    'Msgbox "Execution count is: " & ExecuteCount

    'Validate total count
    If totalCount < 1 Then
    MsgBox "No case has been run.", ,"Cannot Calculate Pass Rate"
    Else
    Dim PassRT, pi, ExecutionRT, pj
    pi = RecSet.FieldValue(0)*100/RecSet1.FieldValue(0)
    PassRT = Round(pi,2) 'Given to two decimal places with current pass rate.
    pj = RecSet2.FieldValue(0)*100/RecSet1.FieldValue(0)
    ExecutionRT = Round(pj,2)
    'VBCRLF means CR'
    Msgbox "The Current Case Pass Rate was: " & PassRT & "%" & vbCrLf & "The Current Execution Rate was: " & ExecutionRT & "%"
    TestSet_Fields("CY_USER_01").Value = PassRT 'Set value to the specified field.
    'Msgbox "The Current Execution Rate was: " & ExecutionRT & "%"
    TestSet_Fields("CY_USER_02").Value = ExecutionRT
    End If

    Above code only allowed to calculate the case pass rate for current test set.

    My question is, how to execute pass rate across different test set? or calculate pass rate for multiple test set

  2. #2
    Junior Member
    Join Date
    Feb 2011
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Caculate Pass rate through script

    Any thought/ideas are appreciate.

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Caculate Pass rate through script

    Done this yet..so forgot it.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:36 AM.

Copyright BetaSoft Inc.