Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QC-QTP Integration
#1
Hello,

I am trying to attach a file in QC test lab-test set- current test from QTP. How can QTP tell which test is being run and then attach the file to the current test only?
Please advise.
-S
Reply
#2
The following function will be useful :

Code:
Function DownloadAttachements(qtApp, tdc, testPath, strFSAPath) For Each oTestSet In tdc.TreeManager.NodeByPath(testPath).TestFactory.NewList("") ScriptName = oTestSet.Name Script = "[QualityCenter] " & testPath & "\" & ScriptName Dim otaAttachmentFactory Dim otaAttachment 'As TDAPIOLELib.Attachment Dim otaAttachmentList 'As List, Dim TAttach 'As Attachment 'As TDAPIOLELib.List Dim otaTreeManager 'As TDAPIOLELib.TreeManager Dim otaSysTreeNode 'As TDAPIOLELib.SysTreeNode Dim otaExtendedStorage, AttachDow Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Set otaAttachmentFactory = oTestSet.Attachments Set otaAttachmentList = otaAttachmentFactory.NewList("") 'MsgBox "Attachment Count:" & otaAttachmentList.Count If otaAttachmentList.Count > 0 Then Set otaAttachment = otaAttachmentList.Item(1) otaAttachment.Load True, "" strPath = otaAttachment.Filename DownloadAttachements = strPath SysPathF = strFSAPath & "Attachments_" & oTestSet.Name Call CreateFolder(SysPathF) SysPath = SysPathF & "\" Call CreateFolder(SysPath) fso.CopyFile strPath, SysPath Else 'MsgBox "Fail" DowloadAttachment = "Empty" End If Set otaAttachmentFactory = Nothing Set otaAttachment = Nothing Set otaAttachmentList = Nothing Set otaTreeManager = Nothing Set otaSysTreeNode = Nothing Set fso = Nothing Next End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Jenkins Integration Problem Sagar Sheth 3 3,616 03-30-2018, 04:11 PM
Last Post: Rahuls848
  JENKINS to QTP Integration Remotely WMI/VBscript help need raju999 0 5,096 01-27-2013, 05:22 AM
Last Post: raju999
  QTP supports 'Team City' Continuous Integration Tool qtpexpert 0 4,699 01-23-2012, 06:20 PM
Last Post: qtpexpert
  QTP & Star Team Integration sumte 0 2,910 02-19-2008, 10:10 PM
Last Post: sumte

Forum Jump:


Users browsing this thread: 1 Guest(s)