2016-11-09 4 views
3

Excel 매크로를 통해 QC ALM에서 테스트 케이스를 실행하려고합니다. 테스트 목록의 테스트에 액세스 할 수 있지만 해당 ID로 실행해야하는 특정 테스트 사례를 찾을 수 없습니다.테스트 ID로 Excel에서 alm으로 테스트 케이스를 실행

Set tsTreeMgr = tdConnection.testsettreemanager 
Set tsFolder = tsTreeMgr.NodeByPath(nPath) 
' --Search for the test set passed as an argument to the example code 
Set tsList = tsFolder.FindTestSets("Test Set Name") 

'------Accessing the Test Cases inside the Test SEt ---- 

Set theTestSet = tsList.Item(1) 
For Each testsetfound In tsList 
    Set tsFolder = testsetfound.TestSetFolder 
    Set tsTestFactory = testsetfound.tsTestFactory 
    Set tsTestList = tsTestFactory.NewList("") 

    For Each tsTest In tsTestList 
     MsgBox (tsTest.Name+","+ tsTest.ID) 
     testrunname = "Test Case name from excel sheet" 
     '----Accesssing the Run Factory --- 
     Set RunFactory = tsTest.RunFactory 
     Set obj_theRun = RunFactory.AddItem(CStr(testrunname)) 
     obj_theRun.Status = "Passed" 
     obj_theRun.Post 
    Next 
Next 

큰 도움이 될 것입니다 실행 testlab의 테스트 세트에서의 TestCase를 얻기 위해 어떤 도움 :

다음은 내가 사용하고 샘플 코드입니다.

답변

2

TSTest 개체의 TestId 속성을 찾고 있다고 생각합니다.

If tsTest.TestId = testidfromexcel Then 
    ' do something 
End If 

또는 당신은 엑셀에서 각각의 테스트 ID와 일치하는 테스트 세트에서 TSTest 인스턴스를 얻을 수있는 필터를 사용할 수 있습니다 :

그래서 루프에 당신은 단지 시험 ID는 엑셀의 값과 일치하는지 여부를 테스트 할 수
Set testSetFilter = tsTestFactory.Filter 
testSetFilter.Filter("TC_TEST_ID") = testidfromexcel 
Set tsTestList = testSetFilter.NewList() 

이제 tsTestList에는 Excel의 ID가있는 테스트의 테스트 인스턴스 만 포함되어야합니다.

+0

두 번째 것은 내가 찾고있는 블록입니다. 인스턴스를 가져올 수 있습니다. 도움을 주셔서 감사합니다 @ Ronald :) –