我正在尝试在“分析视图”中创建报告。使用OTA和HP ALM 11.52。 我已经搜索了OTA参考文档并在线查找了样本,我发现了一些样本,但似乎都没有。
似乎使用了三种方法:
TDConnection.GraphBuilder.BuildGraph(GraphDefinition)
TDConnection.testFactory.BuildSummaryGraph("TS_STATUS", "TS_STATUS", "", 0, myFilter, False, False)
and a third method involving an AnalysisItemFactory object that I can't find anywhere in the OTA documentation.
我已经尝试了前两个,但它们似乎在没有触发错误的情况下运行,但是,ALM中没有显示图表。
这些方法之间有区别,哪种方法最干净?
到目前为止,我的尝试是:
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Method 1: GraphBuilder
'Set GB = QCConnection.GraphBuilder
'Set G1 = GB.CreateGraphDefinition(2, 0)
'G1.Property(0) = "TS_NAME"
'G1.Property(1) = "TC_STATUS"
'Set tsf = QCConnection.TestSetFactory
'Set myFilter = tsf.Filter
'myFilter.Filter ("TC_STATUS") = "Not(N/A)"
'G1.Filter = "Filter: Status[Not N/A]"
'Set g = GB.BuildGraph(G1)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Method 2: BuildSummaryGraph
'Dim testF
'Dim graph1
'Dim Filter
'Set testF = QCConnection.testFactory
'Set myFilter = testF.Filter
'myFilter.Filter("TS_STATUS") = "Not(N/A)"
'Set graph1 = _
'testF.BuildSummaryGraph("TC_NAME", "TS_STATUS", "", 0, myFilter, False, False)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Method 3: AnalysisItemsFactory? I can't find any documentation on this object, yet I've seen it referenced in other code samples.
'Set aiFolderFact = QCConnection.AnalysisItemFolderFactory
'Set aiFact = QCConnection.AnalysisItemFactory ~~~ This line actually runs fine so I know it at least exists. But I am definitely not using the proper methods below.
'Set G1 = aiFact.AddItem("")
'G1.Field("AI_PARENT_ID") = 1001 'Public
'G1.Field("AI_TYPE") = "Graph"
'G1.Field("AI_SUB_TYPE") = "Progress Graph"
'G1.Field("AI_OWNER") = qcUserName.Value
'G1.Field("AI_MODULE") = "requirement"
'G1.Field("AI_NAME") = "test graph"
'G1.Post
正如我之前提到的,所有这些脚本都没有错误运行,但我在分析视图中看不到任何图形。我也注意到似乎没有"姓名"或" Path"字段。
我已经看过这些表格了,而且似乎有一个分析_Item_Folder'和'分析项目'因此,我们知道通过OTA客户端可以做到这一点。是否有一个AnalysisItemFactory,有人可以请提供我正在寻找的样本脚本吗?感谢
答案 0 :(得分:0)
可以在分析文件夹下生成图形,这有点麻烦,因为您需要对数据库,XML和OTA API有充分的了解。没有可用于构建图形的直接API,我已经在下面创建了代码示例
https://github.com/sumeet-kushwah/ALM_OTA_Wrapper/blob/master/ALM_Wrapper/Analysis.cs
检查以下功能
CreateDefectAgeGraph
CreateExcelReport
CreateDefectSummaryGraph
CreateSummaryGraph
这些功能是从下面的测试中调用的
https://github.com/sumeet-kushwah/ALM_OTA_Wrapper/blob/master/ALM_Wrapper_Tests/ALM_Wrapper_Test.cs
寻找测试功能
Test_AnalysisAndDashboardScripts
如果您对此过程有任何疑问,请告诉我。