我要求将所有子文件夹(以及其中的测试集)复制为另一个测试集文件夹下的子文件夹
for eg., lets say i have test set folder
Root\TestSetFolder1
===TestsetSubfolder1
----testset1
---- testset2
====TestSetSubFolder2
-----testset3
----- testset4
i want all of the subfolders and test sets within those folders to be copied under a new test set folder location ,for eg
Root\TestSetFolder2
so after copy the destination folder should have
Root\TestSetFolder2
===TestsetSubfolder1
----testset1
---- testset2
====TestSetSubFolder2
-----testset3
----- testset4
here is the code`enter code here
how do i recursively copy only the subfolders
** Dim tdc,qcServer 设置tdc = CreateObject(" TDApiOle80.TDConnection") qcServer =" http://server.com" tdc.InitConnectionEx qcServer Dim qcUsername As String Dim qcPassword As String Dim qcDomain As String Dim qcProject As String Dim treeMng作为TestSetTreeManager Dim sourceFolder作为testSetFolder Dim destFolder作为testSetFolder Dim iscp作为ISupportCopyPaste Dim clipboard As String
qcUsername =InputBox("Enter QC User Name")
qcPassword = InputBox("Enter QC password")
tdc.Login qcUsername, qcPassword
If (tdc.LoggedIn = false) Then
MsgBox "QC User Authentication failed", vbInformation, "User Authentication"
End If
qcDomain = "FS1"
qcProject = "FQA1"
tdc.Connect qcDomain, qcProject
If (tdc.Connected = failed) Then
MsgBox ("QC Project not connected :" & qcProject), vbInformation, "Project Connection"
End If
call CopyPasteTestSetFolder("Root\F1\F3\F4","Root\F7\test_vb2")
Private Sub CopyPasteTestSetFolder(sourceFolderPath, destFolderPath)
Dim treeMng
Dim sourceFolder
Dim destFolder
Dim iscp
Dim clipboard
Set treeMng = tdc.TestSetTreeManager
Set sourceFolder = treeMng.NodeByPath(sourceFolderPath)
Set destFolder = treeMng.NodeByPath(destFolderPath)
Set iscp = sourceFolder
clipboard = iscp.CopyToClipBoard(sourceFolder.NodeID, 0, sourceFolderPath)
Set iscp = destFolder
iscp.PasteFromClipBoard clipboard, destFolder.NodeID, 0, -1
Set treeMng = Nothing
Set sourceFolder = Nothing
Set destFolder = Nothing
Set iscp = Nothing
End Sub `**
This is giving object is required 424 error at "Set treeMng = tdc.TestSetTreeManager " line