Sunteți pe pagina 1din 2

https://briandamaged.org/blog/?p=307 http://www.vietnamesetestingboard.org/zbxe/?document_srl=164212 http://forums.sureshkumar.net/testing-tools-qa/96537-unable-load-function-librar y-qc-qtp.html http://www.joecolantonio.com/2010/08/17/how-to-save-and-retrieve-a-qc-test-resou rce/ http://www.joecolantonio.com/2011/02/08/how-to-get-a-qc-resource-using-qtp-withota/ http://www.joecolantonio.com/2010/08/17/how-to-save-and-retrieve-a-qc-test-resou rce/ https://briandamaged.org/blog/?p=307 http://qtpvbs.blogspot.com/2010/05/download-all-attachments-from-qc-test.html http://www.advancedqtp.com/forums/index.php/topic,6052.0.

html Re: Export QTP DataTable on QC Resources Module Options 03-25-2011 08:11 AM I, too, could not find any built-in functionality for that. I wrote a function t hat will do what you ask, but only if the data table source in test settings is a test resource in the Test Resources module in ALM/QC. You need to implement Fi le_GetTempFolder() or replace the call with inline code. Kevin Function Alm_ExportAssociatedDataTable: export the datatable to a ALM/Quality ' Center test resource that is associated with the current test ' Parameters: N/A ' Returns: Boolean, true if successful ' TODO: expand to also support exporting to other types of data tables sources ' datatablepath can also refer to an attachment in ALM/Quality Center or local f ile Function Alm_ExportAssociatedDataTable ' As Boolean Dim qtApp ' As QuickTest.Application Dim aDTPathParts ' As Array of String Dim sResourcePath ' As String Dim sResourceName ' As String Dim otaRFFact ' As OTA.QCResourceFolderFactory Dim otaResFolder ' As OTA.QCResourceFolder Dim otaResourceFactory ' As OTA.IQCResourceFactory Dim otaResource ' As OTA.QCResource Dim otaResourceList ' As OTA.List Collection Dim otaResourceFilter ' As OTA.TDFilter Dim aFolders ' As Array of String Dim otaTDC ' As OTA.TDConnection Dim sTempFolder ' As String Dim oFSO ' As Scripting.FileSystemObject Dim i, j Alm_ExportAssociatedDataTable = False Set otaTDC = QCUtil.QCConnection Set qtApp = CreateObject("QuickTest.Application") ' DataTablePath looks like the following when it is a test resoruce so split it up '"[QC-RESOURCE];;Resources\Data Tables;;\Example" aDTPathParts = Split(qtApp.Test.Settings.Resources.DataTablePath, ";;") If UBound(aDTPathParts) <> 2 Or aDTPathParts(0) <> "[QC-RESOURCE]" Then ' DataTa blePath is not a test resource Exit Function

End If sResourcePath = aDTPathParts(1) sResourceName = aDTPathParts(2) ' trim leading \ if present If Left(sResourceName, 1) = "\" Then sResourceName = Right(sResourceName, Len(sR esourceName) - 1) ' need to get the id of the parent folder that contains the data table resorce s o ' we can filter later using the ParentId Set otaRFFact = otaTDC.QCResourceFolderFactory Set otaResFolder = otaRFFact.Root ' the QCResourceFolder Object implements ISysTreeNode2 Interface but does not im plement ' FindChildNode so navigate the resources tree manually... aFolders = Split(sResourcePath, "\") For i = 0 To UBound(aFolders) If Len(aFolders(i)) >0 Then ' skip over empty strings caused by leading/trailing "\"s as well as multiple "\"s For j = 1 To otaResFolder.Count ' iterate over the sub-folders If otaResFolder.Child(j).Type = 10 And otaResFolder.Child(j).Name = aFolders(i) Then Set otaResFolder = otaResFolder.Child(j) Exit For End If Next End If Next Set otaResourceFactory = QCUtil.QCConnection.QCResourceFactory Set otaResourceFilter = otaResourceFactory.Filter otaResourceFilter.Filter("RSC_PARENT_ID") = otaResFolder.id otaResourceFilter.Filter("RSC_NAME") = "'" & sResourceName & "'" Set otaResourceList = otaResourceFilter.NewList() If otaResourceList.Count = 1 Then Set otaResource = otaResourceList.Item(1) sTempFolder = File_GetTempFolder() Datatable.Export sTempFolder & "\" & otaResource.Filename otaResource.Post otaResource.UploadResource sTempFolder, True Alm_ExportAssociatedDataTable = True Set oFSO = CreateObject("Scripting.FileSystemObject") oFSO.DeleteFile(sTempFolder & "\" & otaResource.Filename) End If End Function ' Alm_ExportAssociatedDataTable http://en.wikipedia.org/wiki/Category:English-language_Indian_films http://www.imdb.com/list/3W6AXoxHBp0/

S-ar putea să vă placă și