Using HP Quality Center s API for business focused reporting door Kirsten Ceusters & Kristof Jordens 24 november 2011 voordracht georganiseerd door Discussiegroep Software Testing met de steun van Ingenieurshuis, Antwerpen
Using HP Quality Center s API for business focused reporting Kirsten Ceusters Kristof Jordens Content Introduction HP Quality Center OTA - API Test reporting needs? Demo DIY Summary & Questions 1
Introduction Content Introduction HP Quality Center OTA - API Test reporting needs? Demo DIY Summary & Questions 2
HP Quality Center Requirements module 3
Test Plan module Test Lab module 4
Defects module Fundamental Test Proces vs QC Test Planning Phase Test Plan TRH =Requirements module Test Development Phase TD s = Test Plan module Test Execution Phase Iterations = Test Lab module Defects = Defects module Follow-up Phase Progress Report Dashboard = Dashboard module 5
OTA API Open Test Architecture Application Programming Interface Integration API Manipulation API OTA API HP Quality Center Open Test Architecture API Reference.chm 6
Content Introduction HP Quality Center OTA - API Test reporting needs? Demo DIY Summary & Questions Test reporting needs? custom standard QC reporting module manual automatic 7
QC reporting Test reporting needs? custom Export to MS Excel 1 standard QC reporting module manual automatic 8
Custom reporting Custom reporting 9
Custom reporting Custom reporting 10
Custom reporting Test reporting needs? custom Export to MS Excel 2 QC API 1 standard QC reporting module manual automatic 11
Content Introduction HP Quality Center OTA - API Test reporting needs? Demo DIY Summary & Questions Demo 12
Demo - Automated process in only 4 steps Demo - Dashboard 13
Demo Defect list Demo All Reqs and TC status 14
Content Introduction HP Quality Center OTA - API Test reporting needs? Demo DIY Summary & Questions DIY What do you need? 15
DIY Report definition DIY Excel Macro Design mode Name of the routine called when pressed Name displayed on the button 16
DIY MS VBA Editor content of the xls-file source code area locals window. DIY - Compiling error > OTAClient.dll 17
DIY QC modules vs API references Main Parent OTA object = TDConnection Requirements module = ReqFactory Test Plan module = TestFactory Test Lab module = TestSetTreeManagement Defects module = BugFactory DIY (Dis)Connect Create connection to QC and log in qcserver = http://<server>[:port]/qcbin qcuser = fill in the QC user name qcpassword = fill in the user s password qcdomain = " fill in The name of the project in the Quality Center data base. qcproject = " fill in the logical group of projects in the Quality Center data base. Set tdc = New TDConnection tdc.initconnectionex qcserver tdc.login qcuser, qcpassword tdc.connect qcdomain, qcproject Disconnect project and release connection If tdc.connected Then tdc.disconnect End If If tdc.loggedin Then tdc.logout End If tdc.releaseconnection Set tdc = Nothing 18
DIY Report Defects DIY Declaration Defect fields we are intrested in Titles we want to print in the header of the Excel worksheet 19
DIY Filter Name of the projects we want the defects from Make a defect list with the specified filter Set the filter DIY Fill up array BugTable will be the array to hold the wanted data. Run through the entire bug list and only store the contents of the 8 fields we are intrested in. 20
DIY Write in worksheet Writing the header in the Excel worksheet Defect List Writing the data from BugTable-array in the Excel worksheet Defect List DIY Tip How to know what field(s) you can export out of QC s Defect list from the Defect module? 21
DIY Tip Get_Defect_fields.x ls Connect & login QC DIY Tip Link to the OTA object Write down the QC-names and the user-defined names in the Excel worksheet. 22
DIY Tip Logout of QC DIY Tip Run the macro GetAllDefectFieldsAvailableValues : Worksheet Bug fields & value : You can use these fields in the source code 23
DIY - Dashboard DIY All Reqs and TC status 24
DIY Test Lab Test Case Status Release Phase ProjectID Requirement Test Set DIY QC modules vs API references Main Parent OTA object = TDConnection Requirements module = ReqFactory Test Plan module = TestFactory Test Lab module = TestSetTreeManagement Defects module = BugFactory 25
DIY Function calls Reporting() GetTestLab(ProjectFolderList) CalculateTestCaseReport(TestLabSheet(), ReportTestCases, ReportDashboard) DIY Reporting() Declaration Get form selection: 26
DIY Reporting() Object to get Test Lab module info See next slide for info of ProjectFolderList Call of GetTestLab routine, return value copied in TestLabSheet()-array Call of CalculateTestCaseReport routine, return value copied in TestCases()-array ProjectFolderList If you unfold the other Items, the same is valid 27
DIY GetTestLab(..) DIY GetTestLab(..) 28
DIY CalculateTestCaseReport(..) CalculateTestCaseReport(TestLabSheet(), ReportTestCases, ReportDashboard) DIY CalculateTestCaseReport(..) Activate worksheet Print or update worksheet The code below this part will remove all columns with the QC internal ID s that QC needs to get all data. 29
DIY CalculateTestCaseReport(..) Activate worksheet Print or update worksheet Advantages Customized reports to specific needs Reusable code Reports are easy to create and within a few minutes Everyone can create the same report, using the same logic 30
Content Introduction HP Quality Center OTA - API Test reporting needs? Demo DIY Summary & Questions Questions? ps_testware:: HP Quality Center : kristof.jordens@pstestware.com kirsten.ceusters@pstestware.com http://www.pstestware.com jo.vannut@hp.com jsaelemakers@hp.com http://www.hp.com/software 31
MS Excel OTA Com Type Library QC Server User Form Worksheet result Macro TDConnection qcbin Input selection Reporting() InitNew() BugFactory TestSetTreeMngt InitServerConnection() Defects module TestLab module LoginUserAuthentication() ConnectDomain_Project() Create() SetFilter(Project) GetNewList(Filter) return DefectList(Project) ActivateDefectsWks() WriteDefectInfo() Fill-upArray() with interested fields Create() SetPathToTestLabFolder() return ProjectFolderList() GetProjecFolderList() ActivateOverviewWks() WriteProjReqTSetTCStatus() Fill-upArray() with interested fields and ID s CalculateTestCaseStatusRepor() Includes Project(s) Req(s) Test Set(s) TC( s) State(s) ActivateDashboardWks() WriteProjReqTSetTCStatus() Exit() ReturnFocus() DisconnectDomain_Project() LogoutUser() ReleaseServerConnection()
Consulteer onze website http://www.ie-net.be ie-net vzw Ingenieurhuis Desguinlei 214, B-2018 Antwerpen 1, Tel. 03-260 08 40, Fax 03-216 06 89, E-mail info@ie-net.be Dexia 068-2142216-95 ING 320-0843321-73 BTW BE435567909 http://www.ie-net.be