HP Quality Center’ın OpenAPI’si kullanarak QC dışından işlemlerinizi gerçekleştirebilirsiniz.
Aşağıdaki VBS file parametre olarak geçilmiş bir listeye yeni item ekler.
Aşağıdaki içeriği AddItem.vbs olarak kaydedin.cscript.exe ile Command Prompt’tan örnekteki gibi çağırın.
‘———————————————————————-
‘C:vbs>cscript /nologo AddItem.vbs http://localhost:8080/qcbin DEFAULT QualityCenter_Demo alex_qc “” testlist item2
‘———————————————————————-
If (inArgs.Count < 6) Then
WScript.Echo “Error! Insufficient arguments passed to script!”
WScript.Quit(1)
End if
Dim TD_URL_ADDRESS : TD_URL_ADDRESS = Trim(inArgs(0))
Dim TD_DOMAIN : TD_DOMAIN = Trim(inArgs(1))
Dim TD_PROJECT : TD_PROJECT = Trim(inArgs(2))
Dim TD_USERNAME : TD_USERNAME = Trim(inArgs(3))
Dim TD_PASSWORD : TD_PASSWORD = Trim(inArgs(4))
Dim TD_LISTNAME : TD_LISTNAME = Trim(inArgs(5))
Dim TD_LISTITEM : TD_LISTITEM = Trim(inArgs(6))
Dim tdc
Dim custom ‘As Customization
Dim oLists ‘As CustomizationLists
Dim oList ‘As CustomizationList
Dim Node ‘As CustomizationListNode
WScript.Echo “Trying connection”
Set tdc = CreateObject(“tdapiole80.tdconnection”)
tdc.InitConnectionEx (TD_URL_ADDRESS)
tdc.Login TD_USERNAME , TD_PASSWORD
tdc.Connect TD_DOMAIN , TD_PROJECT
WScript.Echo ” Connected ? :” & tdc.ProjectConnected
If tdc.ProjectConnected Then
Set custom = tdc.Customization
Set oLists = custom.Lists
Set oList = oLists.List(CStr(TD_LISTNAME))
Set Node = oList.RootNode
‘Add child nodes. They are the values of the list.
Node.AddChild CStr(TD_LISTITEM)
custom.Commit
tdc.Logout
End If
If tdc.Connected Then
tdc.Disconnect
End If
tdc.ReleaseConnection
Source: rss