'=====================================================================================================================
'Function Name : QC_AttachScreenshots
'Description : To attach the screenshots to test run in QC
'Author : Jay
'Input Parameter : strScreenshotsFolder - The complete path of the folder that has the screenshots
'Return Value : None
'Date Created : 13/11/2014
'=====================================================================================================================
Function QC_AttachScreenshots (strScreenshotsFolder)
Dim objFSO, objFolderName, objfileList, objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolderName = objFSO.GetFolder(strScreenshotsFolder)
Set objfileList = objFolderName.Files
For each objFile in objfileList
Call QC_AttachFileToTestRun(objFile.Path)
Next
'objFSO.DeleteFolder(Environment.Value("strResPath"))
Set objFSO = Nothing
Set objFolderName = Nothing
Set objfileList = Nothing
End Function
'=====================================================================================================================
'Function Name : QC_AttachFileToTestRun
'Description : To Upload the required File to QC
'Author : Jay
'Input Parameter : strFilePath - The complete path with the file name
'Return Value : None
'Date Created : 13/11/2014
'=====================================================================================================================
Function QC_AttachFileToTestRun(strFilePath)
Dim objQCAttachments, objQCAttachments_Item
Set objQCAttachments = QCUtil.CurrentRun.Attachments
Set objQCAttachments_Item = objQCAttachments.AddItem(Null)
objQCAttachments_Item.FileName = strFilePath
objQCAttachments_Item.Type = 1
objQCAttachments_Item.Post
Set objQCAttachments = Nothing
Set objQCAttachments_Item = Nothing
End Function
'Function Name : QC_AttachScreenshots
'Description : To attach the screenshots to test run in QC
'Author : Jay
'Input Parameter : strScreenshotsFolder - The complete path of the folder that has the screenshots
'Return Value : None
'Date Created : 13/11/2014
'=====================================================================================================================
Function QC_AttachScreenshots (strScreenshotsFolder)
Dim objFSO, objFolderName, objfileList, objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolderName = objFSO.GetFolder(strScreenshotsFolder)
Set objfileList = objFolderName.Files
For each objFile in objfileList
Call QC_AttachFileToTestRun(objFile.Path)
Next
'objFSO.DeleteFolder(Environment.Value("strResPath"))
Set objFSO = Nothing
Set objFolderName = Nothing
Set objfileList = Nothing
End Function
'=====================================================================================================================
'Function Name : QC_AttachFileToTestRun
'Description : To Upload the required File to QC
'Author : Jay
'Input Parameter : strFilePath - The complete path with the file name
'Return Value : None
'Date Created : 13/11/2014
'=====================================================================================================================
Function QC_AttachFileToTestRun(strFilePath)
Dim objQCAttachments, objQCAttachments_Item
Set objQCAttachments = QCUtil.CurrentRun.Attachments
Set objQCAttachments_Item = objQCAttachments.AddItem(Null)
objQCAttachments_Item.FileName = strFilePath
objQCAttachments_Item.Type = 1
objQCAttachments_Item.Post
Set objQCAttachments = Nothing
Set objQCAttachments_Item = Nothing
End Function
Comments