techqa
Newbie
Reged: 03/01/08
Posts: 3
|
|
Hi, I need to pull a report from the Test Lab describing a high level execution to show Test Folders and their Status. So a very basic hish level report. The problem I am facing - If I pull the Cross Test Set report the status available is just Open or Closed. And if I pull the Cross Test Report with Test Sets its more information than needed. Does anyone have any suggestions for this around how to pull this report or how to better organize tests in the Test lab. I have QC 9.2 Will really apprecite any help or suggestions.
Thanks!!!
|
-Asher-
Junior Member
Reged: 08/04/04
Posts: 508
Loc: Wellington, New Zealand
|
|
I personally like the Live Analysis progress graph, grouped by execution status: it shows the number of No run/In Progress/Passed/Failed test instances in all child test sets of the current folder. nice and simple.
It depends what you need - you haven't shared your audience or what level of information you are seeking.
-------------------- Regards,
Alex
... just another Tester ...
|
Jonty
Super Member
Reged: 01/17/07
Posts: 1267
Loc: India
|
|
If you are not able to filter out your specific data, look at Excel reports, you can design and create your own reports directly using the tables and excel code
-------------------- Cheers
Jonty..
-- Here to Learn and share ---
|
techqa
Newbie
Reged: 03/01/08
Posts: 3
|
|
Thank-You for your response. I do not have experience with Excel Reports and currently no access to it as well but I am going to ask for permissions for it. For now I am trying to use the existing reports available in QC. What i need is a high level Test Execution Report to say that all tests in a particular folder or all tests in a test set passed and not go into the details about the tests actually. But if I pull a report around status of Test Set it only has Open or Closed..??..So i was wondering if there is somethign like a cumulative status for all tests within a test set to say ok all passed or if even 1 fails then failed. Please let me know if you have any suggestions on how to achieve this. Thanks!!!
|
sdaly
Member
Reged: 02/22/10
Posts: 25
Loc: DUNDEE
|
|
You may wish to create a macro to pull the metrics out. I prefer this over the excel report generator.
Here is some VBA to pull out test set metrics. Just change the connection string with your details...
Dim tdc As TDConnection
Sub UpdateStats()
'create QC connection QCconnect_silent "URL", "DOMAIN", "PROJECT", "USERNAME", "PASSWORD" 'process tests getMetrics 'disconnect QCdisconnect
End Sub
Private Sub QCconnect_silent(url As String, domain As String, project As String, user As String, pass As String) '# Creates a connection to QC On Error GoTo connected 'create the connection object Set tdc = CreateObject("TDApiOle80.TDConnection") tdc.InitConnectionEx url 'login to QC tdc.Login user, pass 'connect to project tdc.Connect domain, project Application.StatusBar = "Connected to Quality Centre...." Exit Sub connected: Exit Sub End Sub
Private Sub QCdisconnect() '# disconnect from QC and release connection 'check if connection exists If (tdc Is Nothing = False) Then 'disconnect, logout and release connection tdc.Disconnect tdc.Logout tdc.ReleaseConnection Application.StatusBar = "Disconnnected from Quality Centre...." End If End Sub
Private Sub getMetrics() 'create variables Dim TestSetFolderPath, TestName, TestInstance, TestSetName, tsl Dim tsf As TestSetFactory Dim tf As TestFactory Dim filterSet As TDFilter Dim Tset As TestSet Dim testInLab, testList Dim test As TSTest Dim row As Integer Dim execDate, diff Dim totalTestCount, runCount, totalRunCount, passed, totalPassed, failed, totalFailed As Integer Dim runThisWeek, passedThisWeek, failedThisWeek, totalRunThisWeek, totalPassedThisWeek, totalFailedThisWeek As Integer 'write out column headings writeHeadings 'set initial values row = 3 totalRunCount = 0 totalPassed = 0 totalFailed = 0 passed = 0 failed = 0 runCount = 0 runThisWeek = 0 passedThisWeek = 0 failedThisWeek = 0 'get list of test cycles Set tsf = tdc.TestSetFactory Set tsl = tsf.NewList("") 'loop for each test cycle For Each Tset In tsl Application.StatusBar = "Getting Metrics for " & Tset.Name & "...." 'get list of tests in cycle Set testInLab = Tset.TSTestFactory Set testList = testInLab.NewList("") 'output cycle folder\name and number of tests Range("A" & row).Value = Tset.TestSetFolder & "\" & Tset.Name Range("B" & row).Value = testList.Count 'keep total of tests totalTestCount = totalTestCount + testList.Count 'loop for each test in the cycle For Each test In testList 'get the execution date and compare with todays date execDate = test.Field("TC_EXEC_DATE") diff = DateDiff("d", execDate, Date) 'check if test HAS been run If test.Status <> "No Run" Then 'increment count runCount = runCount + 1 'check if the run was this week - 0 to 7 days If diff < 8 Then runThisWeek = runThisWeek + 1 End If 'check if test has passed If test.Status = "Passed" Then 'increment count passed = passed + 1 'check if the run was this week - 0 to 7 days If diff < 8 Then passedThisWeek = passedThisWeek + 1 End If 'check if test has failed If test.Status = "Failed" Then 'increment count failed = failed + 1 'check if the run was this week - 0 to 7 days If diff < 8 Then failedThisWeek = failedThisWeek + 1 End If Next 'output totals for test cycle Range("C" & row).Value = runCount Range("D" & row).Value = runThisWeek Range("E" & row).Value = passed Range("F" & row).Value = passedThisWeek Range("G" & row).Value = failed Range("H" & row).Value = failedThisWeek 'clear objects containing list of tests in cycle Set testsinlab = Nothing Set testList = Nothing 'increment totals totalRunCount = totalRunCount + runCount totalPassed = totalPassed + passed totalFailed = totalFailed + failed totalRunThisWeek = totalRunThisWeek + runThisWeek totalPassedThisWeek = totalPassedThisWeek + passedThisWeek totalFailedThisWeek = totalFailedThisWeek + failedThisWeek 'reset values passed = 0 failed = 0 runCount = 0 runThisWeek = 0 passedThisWeek = 0 failedThisWeek = 0 'increment row number row = row + 1 Next 'end of processing 'increment row to add blank line row = row + 1 'output totals Range("A" & row).Value = "Total" Range("B" & row).Value = totalTestCount Range("C" & row).Value = totalRunCount Range("D" & row).Value = totalRunThisWeek Range("E" & row).Value = totalPassed Range("F" & row).Value = totalPassedThisWeek Range("G" & row).Value = totalFailed Range("H" & row).Value = totalFailedThisWeek 'autofit columns Columns("A:K").EntireColumn.AutoFit 'clear objects containing list of test cycles Set tsf = Nothing Set tsl = Nothing 'inform user of finish MsgBox "Finished" End Sub
Private Sub writeHeadings() '# write out column headings Range("A1").Value = "Quality Center Statistics" Range("B1").Value = "Date: " & Date Range("A2").Value = "Test Cycle" Range("B2").Value = "No. of Tests" Range("C2").Value = "No. Run" Range("D2").Value = "No. Run this Week" Range("E2").Value = "Total No. Passed " Range("F2").Value = "No. Passed this Week" Range("G2").Value = "Total No. Failed" Range("H2").Value = "Total No. Failed this Week" Range("I2").Value = "Current cycle No." Range("J2").Value = "No of Cycles required for complete run" Range("K2").Value = "No of builds required for complete run" End Sub
Hope this is of help Scott
-------------------- TestFire Controller - Open Source Test Automation Management for T-Plan Robot - www.testfire-controller.net
|
-Asher-
Junior Member
Reged: 08/04/04
Posts: 508
Loc: Wellington, New Zealand
|
|
The Live Analysis progress graph will give you exactly what you're asking for with almost zero effort on your part. 1. Click on a Folder in the Test Lab module 2. select the Live Analysis tab 3. Click 'Add graph' in the left-hand pane 4. Choose 'Summary' graph type 5. Click Next 6. Group by Status 7. Click Next 8. Choose 'Test Set' for the X-Axis 9. Click Finish
Now you can see how many tests in each set (in the selected folder) have been executed/passed/failed When you select another Test Lab folder, the settings will remain, so you don't have to set it up again.
The next thing that I do is set up the right hand pane in Live Analysis to show me TREND information 1. Click 'Add graph' in the left-hand pane 2. Choose 'Progress' graph type 3. Click Next 4. Group by Status 5. Click Finish Now you can see your execution states over time.
Very simple, no mucking around with report definitions or filters required.
-------------------- Regards,
Alex
... just another Tester ...
|
dangermouse
Junior Member
Reged: 06/21/05
Posts: 3
|
|
Quote:
You may wish to create a macro to pull the metrics out. I prefer this over the excel report generator.
Here is some VBA to pull out test set metrics. Just change the connection string with your details...
Hope this is of help Scott
I would like to try this. Where do I put all this code?
|
sdaly
Member
Reged: 02/22/10
Posts: 25
Loc: DUNDEE
|
|
dangermouse, its vba so needs to go in a macro, this is written for excel. You can either:
Open excel, add the dev bar which gives a link to the vba editor. Paste in there, change the connection string, save then run.
Or...You can open excel, click to create a new macro, stop recording then edit and paste the code in.
Hope this helps!
-------------------- TestFire Controller - Open Source Test Automation Management for T-Plan Robot - www.testfire-controller.net
|
swc001
Newbie
Reged: 08/07/07
Posts: 2
|
|
Sweet... nice coding, Scott.
Only one coding error... you spelled "center" wrong... :-) (a Brit, perhaps?)
Thanks for sharing.
(another) Scott
|
mihai2dor
Newbie
Reged: 05/11/10
Posts: 5
|
|
Hello sdaly,
Nice reporting tool! I want to uset in my reporting activities but I cannot figure out how to create reports for a specific Folder in QC - I have a folder which contains some test tets, for which I want to create a report.
Can you help me with this issue?
Thanks a lot, Mihai
|
rbreporting
Newbie
Reged: 07/25/10
Posts: 1
|
|
Quote:
I need to pull a report from the Test Lab describing a high level execution to show Test Folders and their Status. So a very basic hish level report.
Check http://www.rbreporting.com The Test Plan Status report does exactly what you have asked. The good thing is that the report is absolutely free.
|
krishna_pandian
Newbie
Reged: 11/21/11
Posts: 1
|
|
Hi sdaly,
I tried to extract the report using the code but i am getting some error when i try to run it. i have changed the below details:
QCconnect_silent "http://l035000:7563/qcbin", "Wording", "Affect", "chinnak", ""
but when i change i run the vba, getting the below error
User Define type not defined: "Dim tdc As TDConnection"
incase if i comment that and run i wil get error in anther place
Dim tsf As TestSetFactory - > error user not defined.
Could you please tell me what i am doing wrong and how should i proceed further to extract the report.
Thanks, Krishna
|
Rajkumar_Rajangam
Veteran
Reged: 10/22/10
Posts: 3136
Loc: Norway
|
|
Krishna,
Add OTA COM Type Library in the References & try again.
-------------------- Rajkumar
|
TestingRam
Newbie
Reged: 10/25/12
Posts: 4
|
|
Hi Friends,
Please suggest any material to learn how write coding. I want to export the test lab report from QC to Excel i am very much interested to learn the coding. Please help me.
Thanks Ram
|