Micro Focus QTP (UFT) Forums
ALM execution status Update - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: ALM execution status Update (/Thread-ALM-execution-status-Update)



ALM execution status Update - patilnagarjuna92 - 03-07-2019

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


RE: ALM execution status Update - Gurusamy - 03-18-2019

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