Esempio n. 1
0
        /// <summary>
        /// Finds testset with testset ID
        /// <para/>returns TDAPIOLELib.TestSet Object
        /// </summary>
        /// <param name="id">ID of the testset</param>
        /// <returns>TDAPIOLELib.TestSet Object</returns>
        public TDAPIOLELib.TestSet GetObjectWithID(int id)
        {
            TDAPIOLELib.TestSetFactory testSetFactory = tDConnection.TestSetFactory as TDAPIOLELib.TestSetFactory;
            TDAPIOLELib.TDFilter       tDFilter       = testSetFactory.Filter as TDAPIOLELib.TDFilter;
            TDAPIOLELib.List           testSetList;
            TDAPIOLELib.TestSet        testSet;

            try
            {
                tDFilter["CY_CYCLE_ID"] = Convert.ToString(id);
                testSetList             = testSetFactory.NewList(tDFilter.Text);

                if (testSetList != null && testSetList.Count == 1)
                {
                    testSet = testSetList[1];
                    return(testSet);
                }
                else
                {
                    throw (new Exception("Unable to find test Set with ID : " + id));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Find test sets under TestLab Folder
        /// <para/>return TDAPIOLELib.List. Each item from the list can be converted to TDAPIOLELib.TestSet
        /// </summary>
        /// <param name="folderPath">TestLab folder path</param>
        /// <returns></returns>
        public TDAPIOLELib.List FindTestSets(String folderPath)
        {
            TDAPIOLELib.TestSetTreeManager testSetTreeManager = tDConnection.TestSetTreeManager;
            TDAPIOLELib.TestSetFolder      testSetFolder      = testSetTreeManager.NodeByPath[folderPath];

            TDAPIOLELib.TestSetFactory testSetFactory = testSetFolder.TestSetFactory;
            TDAPIOLELib.List           OTestSetList   = testSetFactory.NewList("");

            return(OTestSetList);
        }
Esempio n. 3
0
        /// <summary>
        /// Filters tests from test plan using the filter text. Filter text can be colpied directly from ALM and passed to this function.
        /// <para/> returns TDAPIOLELib.List Object. Each item from this list can be coverted to TDAPIOLELib.Test object.
        /// </summary>
        /// <param name="filterString">Copy this from ALM</param>
        /// <returns>TDAPIOLELib.List Object. Each item from this list can be coverted to TDAPIOLELib.Test object.</returns>
        public TDAPIOLELib.List Filter(String filterString)
        {
            TDAPIOLELib.TestSetFactory testSetFactory = tDConnection.TestSetFactory as TDAPIOLELib.TestSetFactory;
            TDAPIOLELib.TDFilter       tDFilter       = testSetFactory.Filter as TDAPIOLELib.TDFilter;
            TDAPIOLELib.List           testList;

            try
            {
                tDFilter.Text = filterString;
                testList      = testSetFactory.NewList(tDFilter.Text);

                return(testList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 /// <summary>
 /// Find test sets under a test set folder
 /// </summary>
 /// <param name="testSetFolder">TDAPIOLELib.TestSetFolder Object</param>
 /// <returns>TDAPIOLELib.List Object containing test set objects</returns>
 public TDAPIOLELib.List FindTestSets(TDAPIOLELib.TestSetFolder testSetFolder)
 {
     TDAPIOLELib.TestSetFactory testSetFactory = testSetFolder.TestSetFactory;
     return(testSetFactory.NewList(""));
 }