Skip Navigation LinksForums > RemoteLaunch Forums > RemoteLaunch Issues & Que... > Programmatically attach f...

Programmatically attach file to test run (QTP) RSS Feed

Tuesday, March 25, 2014
Does anyone have example of code for attaching a file to the current test run?  I would like to include an attachment to an automated QTP test each time it executes from remotelaunch.
2 Replies
Jim R.Jim R.
re: Robert C Mehler on Tuesday, March 25, 2014
Monday, March 31, 2014
Hi Robert

Most likely you'd need us to give you the source code to the QTP plugin, that would be the easiest way. If you send a request to or log a help desk ticket on our website, we can provide it for you.


Robert C MehlerRobert C Mehler
re: Jim R. on Monday, March 31, 2014
Thursday, April 3, 2014

I can include code below in a QTP test to check for a Quality Center connection and attach a file to the current executed run.  Generally I write to a log during a test run and upload to Quality Center at the end of the run.  I may want to use similar code to attach a screenshot or other data that is otherwise lost.  Is there similar code I can use in a QTP script to attach data to the test run in SpiraTeam?

var_connection = QCUtil.IsConnected
If var_connection = True Then
 If QCUtil.CurrentTestSetTest is Nothing then
  Exit Function
  Set CurrentRunObj = QCUtil.CurrentRun.Attachments
  Set AttcObj = CurrentRunObj.AddItem(Null)
  AttcObj.FileName = Log_File
  AttcObj.Type = 1
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set ResultFile = fso.GetFile(Log_File)
 End If 
End If

  • Started: 3/25/2014
  • Last Reply: 4/3/2014
  • Replies: 2
  • Views: 3746
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2017 | Licensed to Inflectra Corporation.