Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Downloading the Test to local PC
#1
Not Solved
Hi

Is there a way to download all the tests that are in a test set in QC to a local drive???

This would be of great help.

Thanks in advance.

-cnu
Reply
#2
Not Solved
All the tests should be on the QC server. You can copy it over ffom there. Else i suggest you check the QC AOM to see if there is a method in the testset factory to download all the test or individually in a loop.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Hi

To download all the tests in a test set to local you can right click on aparticular test and export it to excel.Otherwise using a query u can get the list of tests in a test set.If u need the query let me know.
Reply
#4
Not Solved
Sorry, I was not much explanatory in the last post.

the Test Set contains all the automated tests. I wanted to download on them as QTP tests. (So that I can open in QTP as a test)

Thanks
Srinivas
Reply
#5
Not Solved
Buddy the QC server will hold your test set on a server PC. Do you have access to your QC server? If yes, then QTP tests are only folders which you can copy over as a network share.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#6
Not Solved
interesting... Say I have Admin rights on QC. and Admin rights on the Server where I hosted the QC Server.

Please let me know how the QTP Tests in QC folder structure maps to filesystem folder structure.

Your suggestion is of great help.

-Cnu
Reply
#7
Not Solved
Very well.. Honestly i have never had the privilege to logon to a QC server. But if i were you i would do windows search on the filesystem with the name of the QTP test which actually will lead you to the location of all the scripts.

Let us know the outcome.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#8
Not Solved
hai Cnu,

You can download the scripts from QC to your local system without any admin rights.

call the first function with required details

Code:
If qtApp.TDConnection.IsConnected Then ' If connection is successful

    Set tdc = qtApp.TDConnection.TDOTA
    Set TreeMgr = tdc.TreeManager
    
    ' Use TreeManager.RootList to get the Subject root.
    Set Trees = TreeMgr.RootList(TDOLE_SUBJECT)
    Set MyTrees = TreeMgr.NodeByPath(strTestPlanProjectPath)
    
    If MyTrees.Count = 0 Then
        ModuleName = ""
        testPath = MyTrees.Path
        strFSPath = strSharedFolderPath
        Call CreateFolder(strFSPath)
        If iReplyA = "Yes" Then
            strFSAPath = strFSPath & "\" & Trim(ModuleName) & " Attachments\"
            Call CreateFolder(strFSAPath)
        End If
        Call DownloadScripts(qtApp, tdc, testPath, strFSPath, ModuleName)
        If iReplyA = "Yes" Then
            Call DownloadAttachements(qtApp, tdc, testPath, strFSAPath)
        End If
    End If

   Call CreateFolder(strSharedFolderPath)
  
   For iChild = 1 To MyTrees.Count
        ModuleName = Trim(MyTrees.Child(iChild).Name)
        strFSPath = strSharedFolderPath & "\" & ModuleName
        Call CreateFolder(strFSPath)
        If iReplyA = "Yes" Then
             strFSAPath = strFSPath & "\" & ModuleName & " Attachments\"
            Call CreateFolder(strFSAPath)
        End If
        Set Locate = MyTrees.FindChildNode(ModuleName)
        testPath = Locate.Path
        Call DownloadScripts(qtApp, tdc, testPath, strFSPath, ModuleName)
        If iReplyA = "Yes" Then
            Call DownloadAttachements(qtApp, tdc, testPath, strFSAPath)
        End If
    Next
    
qtApp.TDConnection.Disconnect ' Disconnect from Quality Center

Else
    Msgbox "Cannot connect to Quality Center" ' If connection is not successful, display an error message.
End If

' Exit QuickTest
qtApp.Quit

' Release the Application object
Set qtApp = Nothing
Set Locate = Nothing
Set MyTrees = Nothing
Set Trees = Nothing
Set TreeMgr = Nothing
Set tdc = Nothing

Msgbox "Download Process is completed"

End Sub
Function CreateFolder(strFolderPath)

   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")

   If Not (fso.FolderExists(strFolderPath)) Then
        Set f = fso.CreateFolder(strFolderPath)
        Set f = Nothing
   End If

   Set fso = Nothing
  
End Function

Function DownloadScripts(qtApp, tdc, testPath, strFSPath, ModuleName)

    For Each oTestSet In tdc.TreeManager.NodeByPath(testPath).TestFactory.NewList("")
            
            ScriptName = oTestSet.Name
            Script = "[QualityCenter] " & testPath & "\" & ScriptName
            ScriptFSScript = strFSPath & "\" & ScriptName
            
            resFlag = ""
            Flag = False
            On Error Resume Next
            qtApp.Open Script, False ' Open the test
            If Err.Number <> 0 Then
            Flag = True
            End If
            qtApp.Test.SaveAs ScriptFSScript
            If Err.Number <> 0 Then
            Flag = True
            Else
            qtApp.Test.Close
            End If
            
            If Flag = True Then
                resFlag = "Error: " & Err.Description
                Flag = False
                Err.Clear
            Else
                resFlag = "Pass"
            End If
            Call WriteScriptNames(strFSPath, ScriptName, ModuleName, resFlag)
            
            resFlag = ""
Next
End Function


~ Jay Patel
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Downloading Dialog getting hang bfakruddin 1 1,840 11-26-2012, 07:36 PM
Last Post: ssvali
  Get the Parent Folder name in Test Plan for a Test from Test Lab using QTP godsown 0 5,937 09-29-2011, 04:55 PM
Last Post: godsown
Rolleyes How to retrive manual test cases from QC to excel(local machine) ravi_ram 2 4,025 04-18-2011, 11:04 PM
Last Post: ravi_ram

Forum Jump:


Users browsing this thread: 1 Guest(s)