2014-02-19 2 views
1

QTP에서 BPT 프레임 워크를 사용하고 있으며 동일한 구성 요소를 여러 번 사용하고 있습니다. QC -> Testplan -> TestCase -> Business 구성 요소에서 비즈니스 구성 요소 인스턴스 번호를 가져 오려고합니다. 인스턴스 번호를 바탕으로 엑셀 시트에서 필요한 구성 요소 매개 변수를 읽습니다.QC/ALM에서 비즈니스 구성 요소 인스턴스 번호를 가져 오는 방법

감사합니다. 코드 아래

답변

0

은 나를 위해 일한 :

Set TestTree = TestSet.TSTestFactory 
Set TestList = TestTree.NewList("") 

For Each TSTest In TestList 

    Set Test = TSTest.Test 
    Set objTestFactory = tdc.TestFactory 

    Set tFilter = objTestFactory.Filter 
    tFilter.Filter("TS_TEST_ID") = Test.ID 
    Set tList = objTestFactory.NewList(tFilter.Text) 

    Dim objTest 
    For Each tst In tList 
     If tst.Type = "BUSINESS-PROCESS" Then 
     Set objTest = tst 
     Exit For 
     End If 
    Next 


    If objTest Is Nothing Then 

      Else 
     Dim BPTest As BusinessProcess 
     Set BPTest = objTest 
     BPTest.Load 

     ' Get list if component instance from the Test 
     Set components = BPTest.BPComponents 
     Set Component = components.Item(1) 
     For i = 1 To BPTest.BPComponents.Count 
      componentName = components.Item(i).Name 
      componentInstanceId = components.Item(i).ID 
      ComponentId = components.Item(i).Component.ID 
     Next 
    End if 
Next 

이 코드는 테스트 실험실 수준에서 정보를 가져옵니다 및 비즈니스 구성 요소 수준까지 이동합니다. 현재 컴포넌트 이름과 ID를 추출 중입니다. 필요에 따라 코드를 수정할 수 있습니다.

knowlzz에서 자습서를 방문하십시오. 그것은 각각의 모든 세부 사항으로 솔루션을 멋지게 설명했습니다.

관련 문제