0

the following function does not execute test cases in python I am using python win32 libraries to connect to ALM. I am able to retrieve the names of the test cases from the lab. But cannot execute them


import win32com.client
from re import split
from win32ui import IsObject
from test.test_pydoc import TestDescriptions
import os


def execute_testlab(self,ALM_TEST_SET_PATH):
        bloomtree=self.TDConnection.TreeManager
        try:
            tsFolder=self.TDConnection.TestSetTreeManager.NodeByPath(ALM_TEST_SET_PATH)
            print(tsFolder)
            tsFactory=tsFolder.TestSetFactory
            td_tsetfilter=tsFactory.Filter
            td_testset=td_tsetfilter.NewList()
            for singletest in td_testset:
                print(singletest.Name)
                td_tsTestSetFactory=singletest.TSTestFactory
                td_testlist=td_tsTestSetFactory.NewList("")
                for testitem in td_testlist:
                    print("testname:",testitem.Name)
                    lclRunFactory=testitem.RunFactory
                    lclobjRun=lclRunFactory.AddItem(testitem,"No Run")
                    lclobjRun.StartExecution()
                    lclobjRun.Post()
                    lclobjRun.Run()


1 Answers1

0

See the example in the official docs: https://admhelp.microfocus.com/alm/api_refs/ota/Content/ota/run-test-instance.htm

Sergi
  • 990
  • 5
  • 16