0

OTA を使用して、テスト ケースを Excel から ALM にアップロードしています。

私は Excel アドインを使用しましたが、プロジェクトのニーズに対して非常に扱いにくいことがわかったので、タスクを達成するためのカスタム スクリプトを作成しています。

注: バージョン管理はオンになっています。

バージョン管理がオンになっているため、ステップを追加する前に、作成したテスト ケースをチェックアウトする必要があります。できれば、完了したらテスト ケースを再度チェックインできるようにしたいと考えています。OTA API でこれを行う方法はありますか?

これは私が使用しているスクリプトです:

Sub UploadTC()

Dim QCConnection
Dim qcUserName, qcPassword, qcDomain, qcProj
Dim tsf, trmgr
Dim trfolder, trtest
Dim dsf, dstep, steplist
Dim TCR As Range
Dim cache As Range
Dim scount As Range
'Fields
Dim TCName As Range
Dim TCStep As Range
Dim TCDesc As Range
Dim TCExRe As Range
Dim TCComm As Range
Dim TCType As Range



'~~~These need to come from a user form. Temporary.
qcUserName = "ssoong01"
qcPassword = "*********"
qcDomain = "HUB"
qcProj = "*********"

Set QCConnection = CreateObject("TDApiOle80.TDConnection")
'MsgBox ("Connect to QC Server")

QCConnection.InitConnectionEx "http://hpalm-qc.*****.net:8080/qcbin/"
'MsgBox ("Connection Established.")

QCConnection.Login qcUserName, qcPassword
'MsgBox ("Login Authenticated.")

QCConnection.Connect qcDomain, qcProj
'MsgBox ("Connected to Project.")

Set tsf = QCConnection.TestFactory
Set trmgr = QCConnection.TreeManager

With ThisWorkbook.Sheets("Test Cases")

 'Create Project Folder
Set trfolder = trmgr.NodebyPath("Subject").AddNode(.Cells(3, 2))
trfolder.Post
'Loop through each row in sheet from A4
Set cache = ThisWorkbook.Sheets("Values").Range("$A$3")
For Each TCR In .Range(.Cells(4, 1), .Cells(.Cells(Rows.Count, 1).End(xlUp).Row, 1))
    Set TCName = .Range(TCR.Offset(0, 1).Address)
    Set TCType = .Range(TCR.Offset(0, 7).Address)

    'If Folder Then
        If TCType.Value = "Folder" Then
            Set trfolder = trmgr.NodebyPath("Subject" & TCR.Value).AddNode(TCName.Value)
            trfolder.Post
    'If Test Case Then
        ElseIf TCType.Value = "MANUAL" Then
            'If cached TC name = current row TC name then skip
            If TCName = cache.Value Then
            'Add Test Case
            ElseIf TCName <> cache.Value Then
                Set trfolder = trmgr.NodebyPath("Subject" & TCR.Value)
                Set trtest = trfolder.TestFactory.AddItem(TCName.Value)
                    ' set values
                    trtest.Field("TS_NAME") = TCName
                    trtest.Field("TS_RESPONSIBLE") = qcUserName ' Designer
                    trtest.Field("TS_TYPE") = "MANUAL"

                    trtest.Post

            'Steps
            Set dsf = trtest.DesignStepFactory
            Set steplist = dsf.Newlist("[empty]")

            ' loop through all the steps
            Set scount = .Range(TCName.Address)
            Do
                Set TCStep = .Range(scount.Offset(0, 1).Address)
                Set TCDesc = .Range(scount.Offset(0, 2).Address)
                Set TCExRe = .Range(scount.Offset(0, 3).Address)
                Set TCComm = .Range(scount.Offset(0, 4).Address)

                Set dstep = dsf.AddItem(Null)
                    dstep.Field("DS_STEP_NAME") = TCStep.Value
                    dstep.Field("DS_DESCRIPTION") = TCDesc.Value
                    dstep.Field("DS_EXPECTED") = TCExRe.Value
                    Set scount = .Range(scount.Offset(1).Address)
            Loop Until scount.Value <> scount.Offset(-1).Value

            dstep.Post

                'cache TC name
                cache.Value = TCName.Value
            End If
        Else:
            MsgBox ("Invalid type at cell: " & TCR.Address)
        End If

Next TCR

HP アプリケーション ライフサイクル管理

アプリケーション ライフサイクル管理エディション 11.52.514

OTA クライアント 11.52.514.0

4

2 に答える 2

0

探していた答えが OTA ドキュメントで見つかりました。間違いなく、もっと頻繁に利用すべきリソースです。

于 2015-07-28T19:38:13.247 に答える