Upload Attachments To QC
Function UpLoadAttachmentToQC(FilePath)
Set ObjCurrentTest = QCUtil.CurrentTest.Attachments
Set ObjAttch = ObjCurrentTest.AddItem(Null)
ObjAttch.FileName = FilePath
ObjAttch.Type = 1
ObjAttch.Post
ObjAttch.Refresh
End Function
FilePath=”C:\abc.vbs”
Call UpLoadAttachmentToQC(FilePath)
Author: Mohan Kakarla
Source: QC-OTA
Remove Attachment from QC Through QTP
‘The following function will Remove the specified attachment from the current test of QC when the file name provided
Function RemoveQCAttachements(NameOfTheFile)
var_count= QCUtil.CurrentTest.Attachments.NewList(“”).count
For i= 1 to var_count
If QCUtil.CurrentTest.Attachments.NewList(“”).Item(2).Name =NameOfTheFile Then
AttachmentID = QCUtil.CurrentTest.Attachments.NewList(“”).Item(1).ID
QCUtil.CurrentTest.Attachments.RemoveItem(AttachmentID)
Else
Reporter.ReportEvent micFail,”Please provide the valid filename with extention”,”Please provide the valid filename with extention”
End If
Next
End Function
NameOfTheFile=”abc.vbs” ‘Provide the file name with extension
call RemoveQCAttachements(NameOfTheFile)
Author:Mohan Kakarla
-
Archives
- July 2011 (1)
- March 2011 (1)
- November 2010 (1)
- November 2008 (4)
- October 2008 (2)
- September 2008 (2)
- June 2008 (1)
- March 2008 (4)
- February 2008 (44)
-
Categories
- Automated Test Script Creation Process
- Automating MS Word
- Automating QC
- Automation Object Model For QTP
- Backward compatability in QTP
- Browser Scripts
- COM and QTP
- compare 2 text files
- Descriptive programming
- Descriptive Programming and Child Objetcs
- Dictonary Object
- DotNetFactory
- Excel Automation
- Extra Topics
- Files and Folders
- General Standards to be followed in Test scripts
- New Features In QTP9.5
- QC-OTA
- QTP Additional Faqs
- QTP Faqs
- QTP Naming Convention
- QTP Tips and Faqs
- Running stored procedures from QTP
- Send keyboard keys
- Uncategorized
- Uninstall a software using QTP
- Uninstall a software using vbscript
- Update data in a database
- VBScript and IE Automation
- VBScript Faqs and Useful resources
- What’s New in Quick Test Pro 9.0
- Whats New in QTP 9.5
- XML Scripting
-
RSS
Entries RSS
Comments RSS