HP Quality Center – Create Folder Structure in Test Lab and Pull test Cases from Test Plan

.

Dear LEM Readers,

In previous article, we learnt How to connect to HP QC using Excel Macro. In this article, we are going to learn How to create folder structure in HP QC Test Lab. As you must be knowing – To show the test execution in Test Lab you should follow the below steps:

  1. Create folder structure in Test Lab (most of the time same as in Test Plan but not necessary)
  2. Now Pull the corresponding test cases from Test Plan to Test Lab. Refer Pic 1
HP QC- Mapping Test Cases in Test Lab

Pic 1-HP QC - Mapping Test Cases in Test Lab

Create Folder Structure in Test Lab and Pull test Cases from Test Plan

In this article, you are going to learn how to create folder structure in the Test lab and Mapping or pull test cases from Test Plan to Test Lab.
In order to do so, copy and paste the below code into any of the modules in your VBA code and follow the comments which are written within the code to understand.

Below code will make exactly the same folder structure as Test Plan in the Test lab and It will also map corresponding test cases in the test lab from Test Plan.


Sub Pull_Test_Cases_in_Lab()
On Error Resume Next

Dim tdConnection
Dim qcUser, qcPassword
Dim qcDomain, qcProject
Dim qcURL

Dim myFolder As String
Dim treeMgr As Variant
Dim myTestFact As Variant
Dim myTestFilter As Variant
Dim myTestList As Variant

'Provide all details
    qcUser = ""
    qcDomain = ""
    qcProject = ""
    qcURL = ""
    
'Create QC connection object
Set tdConnection = CreateObject("TDApiOle80.TDConnection")
'Initialise the Quality center connection
   tdConnection.InitConnectionEx qcURL
   'Authenticate username and password
tdConnection.Login qcUser, qcPassword
'login to the domain and project
   tdConnection.Connect qcDomain, qcProject
    Set treeMgr = tdConnection.treemanager
    Set myTestFact = tdConnection.TestFactory
    Set myTestFilter = myTestFact.Filter
    
    ' Apply filter on the last known node
    ' Suppose you want to map all the test cases
    ' of your Project Folder XYZ then provide
    ' the complete path till XYZ
    ' For example: "^\Subject\XYZ\^"
myFolder = "Subject\Test Project 1"

    'Get the complete test list in the main folder
    Set myTestList = myTestFact.newList(myTestFilter.Text)
    myTestFilter.Filter("TS_SUBJECT") = "^\" & myFolder & "^"
    'Exit if no test cases found in the above folder
    If myTestList.Count = 0 Then
        MsgBox "Zero Test Case Found "
        Exit Sub
    End If
    ' get all the tets cases available in the
    ' above main folder
    tcCount = myTestList.Count
    ' traverse through each test cases
    ' in testList array you got
    For Each tc In myTestList
        ' Get the Subject Folder Node
        Set myTCNode = tc.Field("TS_Subject ")
        ' Get Complete path of test case without Test Name
        myPath = myTCNode.path
        'Create Folder stucture and pull the
        ' test cases in to test set in test lab
        ' from test plan
        map_TestCase myPath, tc
    Next
    
    Set myTestList = Nothing
    Set myTestFilter = Nothing
    Set myTestFact = Nothing
End Sub


Sub map_TestCase(myPath, myTC)

         Dim tcMgr As Variant
         Dim myRoot As Variant
         Dim newTSTest As Variant
         Dim TSFact As Variant
         Dim TSFilter As Variant

         On Error Resume Next
        
         Set tcMgr = tdConnection.TestSetTreeManager

         ' Split path for loop
         subjectArray = Split(myPath, "\")
         ' in Test Plan folder structure starts with Subject
         ' while in Test Lab it is "Root ". So we need to change
         ' the path
         NewPath = "Root "
         OldPath = ""

         For iFolder = 1 To UBound(subjectArray)
             'Assign old to new path
             OldPath = NewPath

             'get current folder
             CurrentSubName = subjectArray(iFolder)
             'build new path
             NewPath = Trim(NewPath) & "\" & CurrentSubName
             'search Folder
             Set newNode = tcMgr.NodeByPath(NewPath)

             'create folder if it does not exist
             If newNode Is Nothing Then
                Set tcMgr = Nothing
                Set tcMgr = tdConnection.TestSetTreeManager

                If iFolder = 1 Then
                   Set myRoot = tcMgr.Root
                Else
                    Set myRoot = tcMgr.NodeByPath(OldPath)
                End If ' iFolder'

                Set newNode = myRoot.AddNode(CurrentSubName)
                newNode.Post
             End If 'new Node

             ' if the current folder is the last folder of the array
             ' then create the testset

             If iFolder = UBound(subjectArray) Then

                Set TSFact = newNode.TestSetFactory
                Set TSFilter = TSFact.Filter
                TSFilter.Filter("CY_FOLDER_ID ") = newNode.Nodeid
                TSFilter.Filter("CY_CYCLE ") = CurrentSubName
                Set TSList = TSFact.newList(TSFilter.Text)

                'If no testset found in test plan then TestSet folder will
                'not be created. If you want to do so uncomment the below
                'if else conditions
                
                'If TSList.Count = 0 Then
                   'Set TestSet1 = TSFact.AddItem(Null)
                   'TestSet1.Name = CurrentSubName
                   'TestSet1.Status = "Open "
                   'TestSet1.Post
                'Else
                    Set TestSet1 = TSList.Item(1)
                'End If

                Set TSTestFact = TestSet1.TSTestFactory
                Set TSTestList = TSTestFact.newList("")
                'Initilize the variable to check if any Test case found
                foundTCs = 0

                If TSTestList.Count > 0 Then

                   For Each myTSTest In TSTestList

                       If myTSTest.TestID = Trim(CurrentTest.ID & "") Then
                          foundTCs = 1
                       End If

                   Next

                End If

                 If foundTCs = 0 Then
                    Set newTSTest = TSTestF.AddItem(CurrentTest.ID)
                    newTSTest.Post
                 End If

             End If

             Set newTSTest = Nothing
             Set myTSTest = Nothing
             Set TSFilter = Nothing
             Set TSTestF = Nothing
             Set TSTestList = Nothing
             Set TSFilter = Nothing
             Set TSFact = Nothing
             Set newNode = Nothing
         Next

         On Error GoTo 0
End Sub

Buy a coffee for the author

Adsense

Download FREE Tools and Templates

There are many cool and useful excel tools and templates available to download for free. For most of the tools, you get the entire VBA code base too which you can look into it, play around it, and customize according to your need.

Convert PDF Tables to Excel with VBA | Step-by-Step Guide
Convert PDF Tables to Excel with VBA | Step-by-Step Guide

Convert PDF Tables to Excel with VBA | Step-by-Step Guide How to Convert PDF Tables to Excel Using Excel VBA (Macros) Extracting data from PDF tables into Excel can be tedious, but with Excel VBA (macros), you can automate this process and save time. This guide will...

Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide
Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide

In today's tutorial, we'll be diving into the exciting world of dynamic arrays and spill functions in Office 365 Excel. These features have revolutionized the way we work with data, providing a more flexible and efficient way to handle arrays. I am going to explain...

How to Declare a Public Variable in VBA
How to Declare a Public Variable in VBA

While programming in VBA sometimes you need to declare a Public Variable that can store the value throughout the program. Use of Public Variable: Let's say you have 4 different Functions in your VBA Code or Module and you have a variable that may or may not be...

What is Excel Formula?

Excel Formula is one of the best feature in Microsoft Excel, which makes Excel a very very rich application. There are so many useful built-in formulas available in Excel, which makes our work easier in Excel. For all the automated work, Excel Macro is not required. There are so many automated things can be done by using simple formulas in Excel. Formulas are simple text (With a Syntax) which is entered in to the Excel Worksheet Cells. So how computer will recognize whether it is a formula or simple text? Answer is simple.. every formula in Excel starts with Equal Sign (=).

You May Also Like…

26 Comments

  1. Daniel Ho

    Hello, Mr. Mishra,

    I ran your VBA code but no folder structure created in Test Lab. Please help. Thanks.

    Daniel Ho

    Reply
    • Vishwamitra Mishra

      Hi Daniel,

      Are you getting any error? Can you please specify?

      Reply
      • gaurav mishra

        i didn’t get any error ….but nothing was created in test lab.

        Reply
  2. Daniel Ho

    Hi, Mr. Mishra, I did not get any error, but no folder structure created in the Test Lab Module.

    Question: why tcCount is 283 but not 1? Since there is only one test in

    "SubjectAVP CX ProjectsTest(AVI9999)AVI9999-2013_10_24"

    Please help. Thanks.

    Daniel

    Sub Pull_Test_Cases_in_Lab()

    On Error Resume Next

    Dim tdConnection

    Dim qcUser, qcPassword

    Dim qcDomain, qcProject

    Dim qcURL

    Dim myFolder As String

    Dim treeMgr As Variant

    Dim myTestFact As Variant

    Dim myTestFilter As Variant

    Dim myTestList As Variant

    'Provide all details

    qcUser = "ho_dan"

    qcPassword = "ho_dan"

    qcDomain = "BDC"

    qcProject = "AVP"

    qcURL = "http://10.170.93.98:8080/qcbin/"

    'Create QC connection object

    Set tdConnection = CreateObject("TDApiOle80.TDConnection")

    'Initialise the Quality center connection

    tdConnection.InitConnectionEx qcURL

    'Authenticate username and password

    tdConnection.login qcUser, qcPassword

    'login to the domain and project

    tdConnection.Connect qcDomain, qcProject

    If (tdConnection.LoggedIn True) Then

    MsgBox "QC User Authentication Failed"

    Exit Sub

    End If

    Set treeMgr = tdConnection.TreeManager

    Set myTestFact = tdConnection.TestFactory

    Set myTestFilter = myTestFact.Filter

    'Apply filter on the last known node

    'Suppose you want to map all the test cases of your Project Folder XYZ

    'then provide the complete path till XYZ. For example: "^SubjectXYZ^"

    myFolder = "SubjectAVP CX ProjectsTest(AVI9999)AVI9999-2013_10_24"

    'Get the complete test list in the main folder

    Set myTestList = myTestFact.NewList(myTestFilter.Text)

    myTestFilter.Filter("TS_SUBJECT") = "^" & myFolder & "^"

    'Exit if no test cases found in the main folder

    If myTestList.Count = 0 Then

    MsgBox "Zero Test Case Found "

    Exit Sub

    End If

    'Get all the test cases available in the above main folder

    tcCount = myTestList.Count

    MsgBox "Value " & tcCount & myTestFilter.Filter("TS_SUBJECT")

    'Traverse through each test cases in testList array you got

    For Each tc In myTestList

    'Get the Subject Folder Node

    Set myTCNode = tc.field("TS_Subject")

    'Get Complete path of test case without Test Name

    myPath = myTCNode.Path

    'Create Folder structure and pull the test cases into test set in test lab from test plan

    map_TestCase myPath, tc

    Next

    Set myTestFilter = Nothing

    Set myTestFact = Nothing

    MsgBox "Value " & " " & tcCount & " " & myTCNode & " " & myPath & " " & myTestList.Count

    Set myTestList = Nothing

    MsgBox "Done "

    End Sub

    'Create Folder stucture and pull the test cases into test set in test lab from test plan

    Sub map_TestCase(myPath, myTC)

    Dim tcMgr As Variant

    Dim myRoot As Variant

    Dim newTSTest As Variant

    Dim TSFact As Variant

    Dim TSFilter As Variant

    On Error Resume Next

    Set tcMgr = tdConnection.TestSetTreeManager

    'Split path for loop

    subjectArray = Split(myPath, "")

    'in Test Plan folder structure starts with Subject

    'while in Test Lab it is "Root ". So we need to change the path

    NewPath = "RootAVP Test"

    OldPath = ""

    For iFolder = 1 To UBound(subjectArray)

    'Assign old to new path

    OldPath = NewPath

    'Get current folder

    CurrentSubName = subjectArray(iFolder)

    'Build new path

    NewPath = Trim(NewPath) & "" & CurrentSubName

    'Search Folder

    Set newNode = tcMgr.NodebyPath(NewPath)

    'Create folder if it does not exist

    If newNode Is Nothing Then

    Set tcMgr = Nothing

    Set tcMgr = tdConnection.TestSetTreeManager

    If iFolder = 1 Then

    Set myRoot = tcMgr.Root

    Else

    Set myRoot = tcMgr.NodebyPath(OldPath)

    End If 'iFolder

    Set newNode = myRoot.AddNode(CurrentSubName)

    newNode.Post

    End If 'new Node

    'If the current folder is the last folder of the array then create the test set

    If iFolder = UBound(subjectArray) Then

    Set TSFact = newNode.TestSetFactory

    Set TSFilter = TSFact.Filter

    TSFilter.Filter("CY_FOLDER_ID ") = newNode.Nodeid

    TSFilter.Filter("CY_CYCLE ") = CurrentSubName

    Set TSList = TSFact.NewList(TSFilter.Text)

    'If no test set found in test plan then Test Set folder will

    'not be created. If you want to do so uncomment the below if else conditions

    'If TSList.Count = 0 Then

    ' Set TestSet1 = TSFact.AddItem(Null)

    ' TestSet1.Name = CurrentSubName

    ' TestSet1.Status = "Open "

    ' TestSet1.Post

    'Else

    ' Set TestSet1 = TSList.Item(1)

    'End If

    Set TSTestFact = TestSet1.TSTestFactory

    Set TSTestList = TSTestFact.NewList("")

    'Initilize the variable to check if any Test case found

    foundTCs = 0

    If TSTestList.Count > 0 Then

    For Each myTSTest In TSTestList

    If myTSTest.TestID = Trim(CurrentTest.ID & "") Then

    foundTCs = 1

    End If

    Next

    End If

    If foundTCs = 0 Then

    Set newTSTest = TSTestF.AddItem(CurrentTest.ID)

    newTSTest.Post

    End If

    End If

    Set newTSTest = Nothing

    Set myTSTest = Nothing

    Set TSFilter = Nothing

    Set TSTestF = Nothing

    Set TSTestList = Nothing

    Set TSFilter = Nothing

    Set TSFact = Nothing

    Set newNode = Nothing

    Next

    On Error GoTo 0

    End Sub

    Reply
  3. Daniel Ho

    Hi, Mr. Mishra,

    I got type mismatch on the line below:

    Set myTCNode = tc.Field("TS_Subject ")

    Reply
  4. Daniel Ho

    Mr. Mishra,

    I got type mismatch on the line below:

    Set myTCNode = tc.Field(“TS_Subject “)

    as attached. Thanks.

    Daniel

    Sub Pull_Test_Cases_in_Lab()

    Dim tdConnection

    Dim qcUser, qcPassword

    Dim qcDomain, qcProject

    Dim qcURL

    Dim tcMgr As Variant

    Dim myFolder As String

    Dim treeMgr As Variant

    Dim myTestFact As Variant

    Dim myTestFilter As Variant

    Dim myTestList As Variant

    'Provide all details

    qcUser = "ho_dan"

    qcPassword = "ho_dan"

    qcDomain = "BDC"

    qcProject = "AVP"

    qcURL = "http://10.170.93.98:8080/qcbin/"

    'Create QC connection object

    Set tdConnection = CreateObject("TDApiOle80.TDConnection")

    'Initialise the Quality center connection

    tdConnection.InitConnectionEx qcURL

    'Authenticate username and password

    tdConnection.login qcUser, qcPassword

    'login to the domain and project

    tdConnection.Connect qcDomain, qcProject

    If (tdConnection.LoggedIn True) Then

    MsgBox "QC User Authentication Failed"

    Exit Sub

    End If

    Set treeMgr = tdConnection.TreeManager

    Set myTestFact = tdConnection.TestFactory

    Set myTestFilter = myTestFact.Filter

    'Apply filter on the last known node

    'Suppose you want to map all the test cases of your Project Folder XYZ

    'then provide the complete path till XYZ. For example: "^SubjectXYZ^"

    myFolder = "SubjectAVP CX ProjectsTest (AVI9999)AVI9999-2013_10_24"

    'Get the complete test list in the main folder

    Set myTestList = myTestFact.NewList(myTestFilter.Text)

    myTestFilter.Filter("TS_SUBJECT") = "^" & myFolder & "^"

    'Exit if no test cases found in the main folder

    If myTestList.Count = 0 Then

    MsgBox "Zero Test Case Found "

    Exit Sub

    End If

    'Get all the test cases available in the above main folder

    tcCount = myTestList.Count

    'Traverse through each test cases in testList array you got

    For Each tc In myTestList

    'Get the Subject Folder Node

    Set myTCNode = tc.field("TS_Subject")

    'Get Complete path of test case without Test Name

    Set myPath = myTCNode.Path

    'Create Folder structure and pull the test cases into test set in test lab from test plan

    If (StrComp(myPath, myFolder, 1) = 0) Then

    MsgBox myPath & " " & myFolder

    map_TestCase myPath, tc

    MsgBox "Done "

    End If

    Next

    Set myTestFilter = Nothing

    Set myTestFact = Nothing

    Set myTestList = Nothing

    End Sub

    'Create Folder stucture and pull the test cases into test set in test lab from test plan

    Sub map_TestCase(myPath, myTC)

    Dim tcMgr As Variant

    Dim myRoot As Variant

    Dim newTSTest As Variant

    Dim TSFact As Variant

    Dim TSFilter As Variant

    On Error GoTo errHandler

    Set tcMgr = tdConnection.TestSetTreeManager

    'Split path for loop

    subjectArray = Split(myPath, "")

    'in Test Plan folder structure starts with Subject while in Test Lab it is "Root ". So we need to change the path

    newPath = "RootAVP Test"

    OldPath = ""

    MsgBox newPath

    For ifolder = 1 To UBound(subjectArray)

    'Assign old to new path

    OldPath = newPath

    'Get current folder

    CurrentSubName = subjectArray(ifolder)

    'Build new path

    newPath = Trim(newPath) & "" & CurrentSubName

    'Search Folder

    MsgBox ifolder & " " & newPath

    Set newNode = tcMgr.NodebyPath(newPath)

    'Create folder if it does not exist

    If newNode Is Nothing Then

    Set tcMgr = Nothing

    Set tcMgr = tdConnection.TestSetTreeManager

    If ifolder = 1 Then

    Set myRoot = tcMgr.Root

    Else

    Set myRoot = tcMgr.NodebyPath(OldPath)

    End If 'iFolder

    Set newNode = myRoot.AddNode(CurrentSubName)

    newNode.Post

    End If 'new Node

    'If the current folder is the last folder of the array then create the test set

    If ifolder = UBound(subjectArray) Then

    Set TSFact = newNode.TestSetFactory

    Set TSFilter = TSFact.Filter

    TSFilter.Filter("CY_FOLDER_ID ") = newNode.Nodeid

    TSFilter.Filter("CY_CYCLE ") = CurrentSubName

    Set TSList = TSFact.NewList(TSFilter.Text)

    'If no test set found in test plan then Test Set folder will

    'not be created. If you want to do so uncomment the below if else conditions

    If TSList.Count = 0 Then

    Set TestSet1 = TSFact.AddItem(Null)

    TestSet1.Name = CurrentSubName

    TestSet1.Status = "Open "

    TestSet1.Post

    Else

    Set TestSet1 = TSList.Item(1)

    End If

    Set TSTestFact = TestSet1.TSTestFactory

    Set TSTestList = TSTestFact.NewList("")

    'Initilize the variable to check if any Test case found

    foundTCs = 0

    If TSTestList.Count > 0 Then

    For Each myTSTest In TSTestList

    If myTSTest.TestID = Trim(CurrentTest.ID & "") Then

    foundTCs = 1

    End If

    Next

    End If

    If foundTCs = 0 Then

    Set newTSTest = TSTestF.AddItem(CurrentTest.ID)

    newTSTest.Post

    End If

    End If

    Set newTSTest = Nothing

    Set myTSTest = Nothing

    Set TSFilter = Nothing

    Set TSTestF = Nothing

    Set TSTestList = Nothing

    Set TSFilter = Nothing

    Set TSFact = Nothing

    Set newNode = Nothing

    Next

    errHandler:

    MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & VBE.ActiveCodePane.CodeModule, vbOKOnly, "Error"

    End Sub

    Reply
    • Bhavin

      Daniel,

      Remove the extra space that is present after TS_SUBJECT. It worked for me

      Set myTCNode = tc.Field(“TS_Subject”)

      Reply
  5. Bhavin

    I tried the same code given by you; however it was having minor issues which I have fixed.

    I am facing issue while it is trying to create the folder in test lab:

    Set tcMgr = tdConnection.TestSetTreeManager

    tcMgr is always remaining empty

    Can you please guide where I am missing?

    Below is my code that I am using:

    Public Sub Pull_Test_Cases_in_Lab()

    On Error Resume Next

    Dim tdConnection

    Dim myFolder As String

    Dim treeMgr As Variant

    Dim myTestFact As Variant

    Dim myTestFilter As Variant

    Dim myTestList As Variant

    Set tdConnection = CreateObject("TDApiOle80.TDConnection")

    tdConnection.InitConnectionEx main.qcURL

    tdConnection.Login main.qcUser, main.qcPassword

    tdConnection.Connect main.qcDomain, main.qcProject

    Set treeMgr = tdConnection.treemanager

    Set myTestFact = tdConnection.TestFactory

    Set myTestFilter = myTestFact.Filter

    'myFolder = "SubjectApplicationsXXXYYY AAA ZZZ"

    myTestFilter.Filter("TS_SUBJECT") = "^" & main.myFolder & "^"

    Set myTestList = myTestFact.newList(myTestFilter.Text)

    If myTestList.Count = 0 Then

    MsgBox "Zero Test Case Found "

    Exit Sub

    End If

    tcCount = myTestList.Count

    For Each tc In myTestList

    Set myTCNode = tc.Field("TS_Subject")

    myPath = myTCNode.Path

    map_TestCase myPath, tc

    Next

    Set myTestList = Nothing

    Set myTestFilter = Nothing

    Set myTestFact = Nothing

    End Sub

    Public Sub map_TestCase(myPath, myTC)

    Dim tcMgr As Variant

    Dim myRoot As Variant

    Dim newTSTest As Variant

    Dim TSFact As Variant

    Dim TSFilter As Variant

    On Error Resume Next

    Set tcMgr = tdConnection.TestSetTreeManager

    ' Split path for loop

    subjectArray = Split(myPath, "")

    ' in Test Plan folder structure starts with Subject

    ' while in Test Lab it is "Root ". So we need to change

    ' the path

    NewPath = "Root"

    OldPath = ""

    For IFolder = 1 To UBound(subjectArray)

    'Assign old to new path

    OldPath = NewPath

    'get current folder

    CurrentSubName = subjectArray(IFolder)

    'build new path

    NewPath = Trim(NewPath) & "" & CurrentSubName

    'search Folder

    Set newNode = tcMgr.NodeByPath(NewPath)

    'create folder if it does not exist

    If newNode Is Nothing Then

    Set tcMgr = Nothing

    Set tcMgr = tdConnection.TestSetTreeManager

    If IFolder = 1 Then

    Set myRoot = tcMgr.Root

    Else

    Set myRoot = tcMgr.NodeByPath(OldPath)

    End If ' iFolder'

    Set newNode = myRoot.AddNode(CurrentSubName)

    newNode.Post

    End If 'new Node

    ' if the current folder is the last folder of the array

    ' then create the testset

    If IFolder = UBound(subjectArray) Then

    Set TSFact = newNode.TestSetFactory

    Set TSFilter = TSFact.Filter

    TSFilter.Filter("CY_FOLDER_ID") = newNode.Nodeid

    TSFilter.Filter("CY_CYCLE") = CurrentSubName

    Set TSList = TSFact.newList(TSFilter.Text)

    'If no testset found in test plan then TestSet folder will

    'not be created. If you want to do so uncomment the below

    'if else conditions

    'If TSList.Count = 0 Then

    'Set TestSet1 = TSFact.AddItem(Null)

    'TestSet1.Name = CurrentSubName

    'TestSet1.Status = "Open "

    'TestSet1.Post

    'Else

    Set TestSet1 = TSList.Item(1)

    'End If

    Set TSTestFact = TestSet1.TSTestFactory

    Set TSTestList = TSTestFact.newList("")

    'Initilize the variable to check if any Test case found

    foundTCs = 0

    If TSTestList.Count > 0 Then

    For Each myTSTest In TSTestList

    If myTSTest.TestID = Trim(CurrentTest.ID & "") Then

    foundTCs = 1

    End If

    Next

    End If

    If foundTCs = 0 Then

    Set newTSTest = TSTestF.AddItem(CurrentTest.ID)

    newTSTest.Post

    End If

    End If

    Set newTSTest = Nothing

    Set myTSTest = Nothing

    Set TSFilter = Nothing

    Set TSTestF = Nothing

    Set TSTestList = Nothing

    Set TSFilter = Nothing

    Set TSFact = Nothing

    Set newNode = Nothing

    Next

    On Error GoTo 0

    End Sub

    Reply
    • Dhananjay

      Hi Bhavin,
      Do have still have the correct code to create test lab structure as like test plan pull the test cases from test plan to test lab.?
      could youplease forward me the same on dkmitkari@gmail.com

      Reply
  6. Melvin

    Hi,

    Thanks for this code! I got a few questions:

    – in TSList.Count I'm getting a lot but my test cases are only 130.

    – What object is tc in the loop of myTestList since object is not recognize thus I'm not getting the myPath, tc variables.

    Thanks,

    melvin

    Reply
    • Divakar

      Hello Melvin,

      Can you please share your code

      Reply
  7. Ronak Gavandi

    Hi,

    I was looking for a code snippet to:

    1. Upload test cases from excel to QC
    2. Check for existing custom fields added to the test plan test factory
    3. Add a new custom field to the test plan test factory

    Reply
  8. Divakar

    Hi Vishwa,

    I have tried the above code and getting subject is empty error can you please post the working code here since m trying this from long time.

    I request some one to post the working code for me.

    Thanks,
    DIVA

    Reply
  9. Divakar

    Hi Vishwa,

    Can you please post the working code here. I request some one to post it if you have it.

    Thanks

    Reply
  10. Amit

    I am trying to write a VBA excel macro code to upload attachment to a specific test script in Test Lab. I am able to connect to Quality center but not able to identify specific test case in Test Lab

    How can we achieve this?

    Reply
  11. Tina

    Hi,

    could you please help me in creating a macro that uploads the results pass fail from excel to ALM 11. This is of great help for our project with 1000s of test case whose results have to manually updated.

    Thanks,
    Tina

    Reply
    • Adam

      Hi Tina. Were you able to find/create a macro to do that for you? If yes, would mind sharing it with me?

      Reply
      • anup

        HI

        I am also looking for code which will attached result to test case and pass it. would you mind sharing it with me.

        Reply
  12. Vijay

    Hi Vishwa,

    I need your help to create excel macros which will export the Test case names and their execution status(Pass, fail, No Run etc) from QC Test-lab to Excel sheet.

    Could you please help on this.
    Thanks a lot in advance.

    Reply
  13. Raj

    I need code to upload test scripts into Quality center…Could you please help me on this…

    Reply
  14. Vinay

    Hi Vishwa,

    I am able to connect QC but inned to open QC in Explorer and i want s to go defect Tab from that i needs to get the Linked defects deatils.

    Please help me to get the solution for this issue.

    Reply
  15. Vinay

    Hi,

    I have to open ALM in explorer and after i needs to get the linked defects in Defects TAB. please help to get the solution for this qns….

    Reply
  16. Gireesh

    even me too, i could not crate finally the test sets.

    Reply
  17. Dhrub

    I want to fetch release and requirement details from QC with VBA Macro
    but the below line is not working

    folderFactory = QCConnection.ReleaseFactory

    Error = “Wrong number of argument or invalid property assignment”

    Please help.

    Reply
  18. Shweta Aggarwal

    I am unable to execute the above mentioned code and the error is – “Pure virtual function calling”. Please help.

    Reply
  19. Navya

    Hi everyone,
    please post code for executing testcases in QC for a specific folder using excel macro

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Join and get a FREE! e-Book

Don't miss any articles, tools, tips and tricks, I publish here

You have Successfully Subscribed!

Pin It on Pinterest