0% found this document useful (0 votes)
347 views2 pages

QC Script

This document discusses exporting a QuickTest data table to a test resource in HP ALM/QC. It provides a Function that retrieves the associated test resource using the resource ID and name, exports the data table to a temporary file, uploads it to the test resource in QC, and cleans up by deleting the temporary file. The function returns a Boolean for whether it was successful. It only works if the data table source is a test resource, and assumes the data table path is formatted a certain way when associated with a resource.

Uploaded by

Anand Reddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
347 views2 pages

QC Script

This document discusses exporting a QuickTest data table to a test resource in HP ALM/QC. It provides a Function that retrieves the associated test resource using the resource ID and name, exports the data table to a temporary file, uploads it to the test resource in QC, and cleans up by deleting the temporary file. The function returns a Boolean for whether it was successful. It only works if the data table source is a test resource, and assumes the data table path is formatted a certain way when associated with a resource.

Uploaded by

Anand Reddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 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/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy