[TestSet中的OTA API运行测试

问题描述 投票:0回答:1

我们登录到应用程序并在应用程序内执行所有测试。如果测试失败,那么我们清除环境(关闭浏览器和进程)并再次登录,但仅在测试失败时才登录。

为了获得此行为,我需要逐个测试运行测试集,以便暂停全局执行以执行登录,然后继续测试。

问题是,当我在“ TestList”中进行迭代时,每次运行(Scheduler.Run(Test))都在执行孔TestSet,而不仅仅是TestSet中的一个测试。

所以我们编写了以下代码:

Set TSetFact = ALMConnection.TestSetFactory
Set tsTreeMgr = ALMConnection.TestSetTreeManager

Set TestFolderNode = tsTreeMgr.NodeByPath(FolderPath)
Set SubFolderNode = TestFolderNode.NewList
Set TestSetNode = TestFolderNode.TestSetFactory
Set TestSetList = TestSetNode.NewList("")

For Each TestSet In TestSetList 

    Set TestFactory=TestSet.tsTestFactory
    Set TestList = TestFactory.NewList("")
    For Each Test In TestList

        Set Scheduler = TestSet.StartExecution("")
        Scheduler.RunAllLocally = True
        Scheduler.Run(Test)
        Set execStatus = Scheduler.ExecutionStatus

        Do While RunFinished = False
            execStatus.RefreshExecStatusInfo "all", True
            RunFinished = execStatus.Finished
            Set EventsList = execStatus.EventsList

            For Each ExecEventInfoObj in EventsList
                strNowEvent = ExecEventInfoObj.EventType
                If strNowEvent=1 Then
                    flagFail=1
                    KillProcess ("UFTRemoteAgent.exe")
                    Login(FolderPath)
                    Exit For
                End If
            Next

            If flagFail=1 Then
            RunFinished = True
            flagFail=0
            End If
        Loop

        KillProcess ("UFTRemoteAgent.exe")
        Set Scheduler = Nothing
        Set execStatus=Nothing
        Set EventsList=Nothing
        Set ExecEventInfoObj=Nothing
        Set strNowEvent=Nothing
        RunFinished = False
    Next
    Set TestFactory=Nothing
    Set TestList=Nothing
Next

已解决:http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/OTA-API-Running-TestSet-one-test-at-the-time/td-p/6800861

api vbscript ota alm qc
1个回答
0
投票

我也面临同样的问题,但我无权访问此链接。能否请您提供解决方案。

先谢谢您。

© www.soinside.com 2019 - 2024. All rights reserved.