Posts: 1
Threads: 1
Joined: Mar 2019
Reputation:
0
03-07-2019, 01:27 PM
I have to update the execution status (Passed, Failed, Not Completed) in ALM through OTA / VBS scripts. I am unable to update the status.
Can you please share code
Thanks,
Guru
Posts: 1
Threads: 0
Joined: Apr 2014
Reputation:
0
03-18-2019, 08:09 PM
Find the Code for Update the Status in ALM test Lab.
Dim tdc
Dim runName
Set tdc = CreateObject("TDAPIOLE80.TDConnection")
tdc.InitConnectionEx "ALM URL"
tdc.Login "User Name", "Password"
tdc.Connect "Domain", "Project"
If (tdc.connected <> True) Then
MsgBox "qc project failed to connect to " &"Project"
ExitTest()
End If
Set tfact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tcTreeMgr = tdc.TreeManager
nPath = "Root\" & Trim("ZZ_ToBe_Deleted\LER")
Set TestSetFolder = tsTreeMgr.NodeByPath(npath)
Set TestSetF = TestSetFolder.TestSetFactory 'Retreive test from given folder in test lab
Set aTestSetArray = TestSetF.NewList("")
tsSet_cnt=aTestSetArray.Count
For i=1 to tsSet_cnt ' Loop through the Test Sets to pick the desired test Set
Set tstests=aTestSetArray.Item(i)
TestSet_Name=tstests.Name
'''PRINT TestSet_Name
If TestSet_Name= "LER3" Then
Flag=1
Set TestCaseF = tstests.TSTestFactory 'Retreive Test Cases from the test set
Set aTestCaseArray = TestCaseF.NewList("")
test_qc_cnt=aTestCaseArray.count
For n=1 to test_qc_cnt 'Loop through the Test cases in QC to find the same test case as in Excel
Set ts_obj=aTestCaseArray.item(n)
tname_QC=ts_obj.Test.Name
Set RunF = ts_obj.RunFactory '''for managing test runs.
Set theRun = RunF.AddItem(tname_QC)
theRun.Name =tname_QC '''assign a run name
theRun.Status ="Failed" '''you can parametrize this value as per your need
theRun.Post
theRun.Refresh
Next
End If
Next
Thanks,
Guru